Skip to content

Commit e2e7087

Browse files
committed
allow setting replication strategy
1 parent e13ce35 commit e2e7087

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/client/client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,18 @@ export class Client extends EventEmitter<Events> {
126126
/**
127127
* Send a message to all clients which are subscribed to the given world.
128128
* @param worldName World Name
129+
* @param replication Optional Replication Strategy, defaults to `ExceptSelf`
129130
* @param payload Optional Message Payload
130131
*/
131132
public globalMessage(
132133
worldName: string,
134+
replication = Replication.ExceptSelf,
133135
payload?: Readonly<MessagePayload>
134136
): void {
135137
this.sendRawMessage({
136138
instruction: Instruction.GlobalMessage,
137139
worldName,
140+
replication,
138141
parameter: payload?.parameter,
139142
flex: payload?.flex,
140143
records: payload?.records,
@@ -146,16 +149,19 @@ export class Client extends EventEmitter<Events> {
146149
* Send a message to all clients which are subscribed to a certain area in the given world.
147150
* @param worldName World Name
148151
* @param position Message Position
152+
* @param replication Optional Replication Strategy, defaults to `ExceptSelf`
149153
* @param payload Optional Message Payload
150154
*/
151155
public localMessage(
152156
worldName: string,
153157
position: Readonly<Vector3>,
158+
replication = Replication.ExceptSelf,
154159
payload?: Readonly<MessagePayload>
155160
): void {
156161
this.sendRawMessage({
157162
instruction: Instruction.LocalMessage,
158163
worldName,
164+
replication,
159165
position,
160166
parameter: payload?.parameter,
161167
flex: payload?.flex,

0 commit comments

Comments
 (0)