hytopia 0.1.70 → 0.1.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/server.chatmanager.md +46 -2
- package/docs/server.chatmanager.onbroadcastmessage.md +13 -0
- package/docs/server.chatmanager.sendbroadcastmessage.md +1 -1
- package/docs/server.chatmanager.sendplayermessage.md +1 -1
- package/package.json +1 -1
- package/server.api.json +41 -2
- package/server.d.ts +12 -2
- package/server.js +37 -37
@@ -35,6 +35,50 @@ world.chatManager.registerCommand('/kick', (player, args, message) => {
|
|
35
35
|
});
|
36
36
|
```
|
37
37
|
|
38
|
+
## Properties
|
39
|
+
|
40
|
+
<table><thead><tr><th>
|
41
|
+
|
42
|
+
Property
|
43
|
+
|
44
|
+
|
45
|
+
</th><th>
|
46
|
+
|
47
|
+
Modifiers
|
48
|
+
|
49
|
+
|
50
|
+
</th><th>
|
51
|
+
|
52
|
+
Type
|
53
|
+
|
54
|
+
|
55
|
+
</th><th>
|
56
|
+
|
57
|
+
Description
|
58
|
+
|
59
|
+
|
60
|
+
</th></tr></thead>
|
61
|
+
<tbody><tr><td>
|
62
|
+
|
63
|
+
[onBroadcastMessage?](./server.chatmanager.onbroadcastmessage.md)
|
64
|
+
|
65
|
+
|
66
|
+
</td><td>
|
67
|
+
|
68
|
+
|
69
|
+
</td><td>
|
70
|
+
|
71
|
+
(player: [Player](./server.player.md) \| undefined, message: string, color?: string) => void
|
72
|
+
|
73
|
+
|
74
|
+
</td><td>
|
75
|
+
|
76
|
+
_(Optional)_ A function that is called when a broadcast (public) message is sent by a player or the server.
|
77
|
+
|
78
|
+
|
79
|
+
</td></tr>
|
80
|
+
</tbody></table>
|
81
|
+
|
38
82
|
## Methods
|
39
83
|
|
40
84
|
<table><thead><tr><th>
|
@@ -77,7 +121,7 @@ Register a command and its callback.
|
|
77
121
|
|
78
122
|
</td><td>
|
79
123
|
|
80
|
-
Send a broadcast message to all players in the world.
|
124
|
+
Send a system broadcast message to all players in the world.
|
81
125
|
|
82
126
|
|
83
127
|
</td></tr>
|
@@ -91,7 +135,7 @@ Send a broadcast message to all players in the world.
|
|
91
135
|
|
92
136
|
</td><td>
|
93
137
|
|
94
|
-
Send a message to a specific player, only visible to them.
|
138
|
+
Send a system message to a specific player, only visible to them.
|
95
139
|
|
96
140
|
|
97
141
|
</td></tr>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [ChatManager](./server.chatmanager.md) > [onBroadcastMessage](./server.chatmanager.onbroadcastmessage.md)
|
4
|
+
|
5
|
+
## ChatManager.onBroadcastMessage property
|
6
|
+
|
7
|
+
A function that is called when a broadcast (public) message is sent by a player or the server.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
onBroadcastMessage?: (player: Player | undefined, message: string, color?: string) => void;
|
13
|
+
```
|
package/package.json
CHANGED
package/server.api.json
CHANGED
@@ -4665,6 +4665,45 @@
|
|
4665
4665
|
"name": "ChatManager",
|
4666
4666
|
"preserveMemberOrder": false,
|
4667
4667
|
"members": [
|
4668
|
+
{
|
4669
|
+
"kind": "Property",
|
4670
|
+
"canonicalReference": "server!ChatManager#onBroadcastMessage:member",
|
4671
|
+
"docComment": "/**\n * A function that is called when a broadcast (public) message is sent by a player or the server.\n *\n * @param player - The player that sent the message, or undefined if the message is a system message from the server.\n *\n * @param message - The message to send.\n *\n * @param color - The color of the message as a hex color code, excluding #.\n */\n",
|
4672
|
+
"excerptTokens": [
|
4673
|
+
{
|
4674
|
+
"kind": "Content",
|
4675
|
+
"text": "onBroadcastMessage?: "
|
4676
|
+
},
|
4677
|
+
{
|
4678
|
+
"kind": "Content",
|
4679
|
+
"text": "(player: "
|
4680
|
+
},
|
4681
|
+
{
|
4682
|
+
"kind": "Reference",
|
4683
|
+
"text": "Player",
|
4684
|
+
"canonicalReference": "server!Player:class"
|
4685
|
+
},
|
4686
|
+
{
|
4687
|
+
"kind": "Content",
|
4688
|
+
"text": " | undefined, message: string, color?: string) => void"
|
4689
|
+
},
|
4690
|
+
{
|
4691
|
+
"kind": "Content",
|
4692
|
+
"text": ";"
|
4693
|
+
}
|
4694
|
+
],
|
4695
|
+
"isReadonly": false,
|
4696
|
+
"isOptional": true,
|
4697
|
+
"releaseTag": "Public",
|
4698
|
+
"name": "onBroadcastMessage",
|
4699
|
+
"propertyTypeTokenRange": {
|
4700
|
+
"startIndex": 1,
|
4701
|
+
"endIndex": 4
|
4702
|
+
},
|
4703
|
+
"isStatic": false,
|
4704
|
+
"isProtected": false,
|
4705
|
+
"isAbstract": false
|
4706
|
+
},
|
4668
4707
|
{
|
4669
4708
|
"kind": "Method",
|
4670
4709
|
"canonicalReference": "server!ChatManager#registerCommand:member(1)",
|
@@ -4733,7 +4772,7 @@
|
|
4733
4772
|
{
|
4734
4773
|
"kind": "Method",
|
4735
4774
|
"canonicalReference": "server!ChatManager#sendBroadcastMessage:member(1)",
|
4736
|
-
"docComment": "/**\n * Send a broadcast message to all players in the world.\n *\n * @param message - The message to send.\n *\n * @param color - The color of the message as a hex color code, excluding #.\n *\n * @example\n * ```typescript\n * chatManager.sendBroadcastMessage('Hello, world!', 'FF00AA');\n * ```\n *\n */\n",
|
4775
|
+
"docComment": "/**\n * Send a system broadcast message to all players in the world.\n *\n * @param message - The message to send.\n *\n * @param color - The color of the message as a hex color code, excluding #.\n *\n * @example\n * ```typescript\n * chatManager.sendBroadcastMessage('Hello, world!', 'FF00AA');\n * ```\n *\n */\n",
|
4737
4776
|
"excerptTokens": [
|
4738
4777
|
{
|
4739
4778
|
"kind": "Content",
|
@@ -4797,7 +4836,7 @@
|
|
4797
4836
|
{
|
4798
4837
|
"kind": "Method",
|
4799
4838
|
"canonicalReference": "server!ChatManager#sendPlayerMessage:member(1)",
|
4800
|
-
"docComment": "/**\n * Send a message to a specific player, only visible to them.\n *\n * @param player - The player to send the message to.\n *\n * @param message - The message to send.\n *\n * @param color - The color of the message as a hex color code, excluding #.\n *\n * @example\n * ```typescript\n * chatManager.sendPlayerMessage(player, 'Hello, player!', 'FF00AA');\n * ```\n *\n */\n",
|
4839
|
+
"docComment": "/**\n * Send a system message to a specific player, only visible to them.\n *\n * @param player - The player to send the message to.\n *\n * @param message - The message to send.\n *\n * @param color - The color of the message as a hex color code, excluding #.\n *\n * @example\n * ```typescript\n * chatManager.sendPlayerMessage(player, 'Hello, player!', 'FF00AA');\n * ```\n *\n */\n",
|
4801
4840
|
"excerptTokens": [
|
4802
4841
|
{
|
4803
4842
|
"kind": "Content",
|
package/server.d.ts
CHANGED
@@ -614,6 +614,15 @@ export declare enum ChatEventType {
|
|
614
614
|
* @public
|
615
615
|
*/
|
616
616
|
export declare class ChatManager {
|
617
|
+
/**
|
618
|
+
* A function that is called when a broadcast (public) message is sent
|
619
|
+
* by a player or the server.
|
620
|
+
*
|
621
|
+
* @param player - The player that sent the message, or undefined if the message is a system message from the server.
|
622
|
+
* @param message - The message to send.
|
623
|
+
* @param color - The color of the message as a hex color code, excluding #.
|
624
|
+
*/
|
625
|
+
onBroadcastMessage?: (player: Player | undefined, message: string, color?: string) => void;
|
617
626
|
|
618
627
|
|
619
628
|
|
@@ -629,7 +638,7 @@ export declare class ChatManager {
|
|
629
638
|
*/
|
630
639
|
unregisterCommand(command: string): void;
|
631
640
|
/**
|
632
|
-
* Send a broadcast message to all players in the world.
|
641
|
+
* Send a system broadcast message to all players in the world.
|
633
642
|
* @param message - The message to send.
|
634
643
|
* @param color - The color of the message as a hex color code, excluding #.
|
635
644
|
*
|
@@ -640,7 +649,7 @@ export declare class ChatManager {
|
|
640
649
|
*/
|
641
650
|
sendBroadcastMessage(message: string, color?: string): void;
|
642
651
|
/**
|
643
|
-
* Send a message to a specific player, only visible to them.
|
652
|
+
* Send a system message to a specific player, only visible to them.
|
644
653
|
* @param player - The player to send the message to.
|
645
654
|
* @param message - The message to send.
|
646
655
|
* @param color - The color of the message as a hex color code, excluding #.
|
@@ -653,6 +662,7 @@ export declare class ChatManager {
|
|
653
662
|
sendPlayerMessage(player: Player, message: string, color?: string): void;
|
654
663
|
|
655
664
|
|
665
|
+
|
656
666
|
}
|
657
667
|
|
658
668
|
/**
|