Trigger Reference of GS2-Chat Script
Reference for event triggers that call extended scripts, as defined in GS2-Chat
createRoom
Event trigger to call GS2-Script before a room is created.
Request
| Type | Description |
---|
namespace | Namespace | Namespace |
room | Room | Room |
Result
| Type | Require | Default | Limitation | Description |
---|
permit | bool | ✓ | | | Allow room creation? |
Implementation Example
namespace = args.namespace
room = args.room
result = {
permit=permit
}
createRoomDone
GS2-Script called after a room is created.
Request
| Type | Description |
---|
namespace | Namespace | Namespace |
room | Room | Room |
Result
| Type | Require | Default | Limitation | Description |
---|
Implementation Example
namespace = args.namespace
room = args.room
result = {
}
deleteRoom
Event trigger to call GS2-Script before a room is deleted.
Request
| Type | Description |
---|
namespace | Namespace | Namespace |
room | Room | Room |
Result
| Type | Require | Default | Limitation | Description |
---|
permit | bool | ✓ | | | Allow room deletion or |
Implementation Example
namespace = args.namespace
room = args.room
result = {
permit=permit
}
deleteRoomDone
GS2-Script called after a room is deleted.
Request
| Type | Description |
---|
namespace | Namespace | Namespace |
room | Room | Room |
Result
| Type | Require | Default | Limitation | Description |
---|
Implementation Example
namespace = args.namespace
room = args.room
result = {
}
postMessage
Event trigger to call GS2-Script before posting a message.
Request
| Type | Description |
---|
namespace | Namespace | Namespace |
room | Room | Room |
message | Message | Message |
Result
| Type | Require | Default | Limitation | Description |
---|
permit | bool | ✓ | | | Allow message posting or |
Implementation Example
namespace = args.namespace
room = args.room
message = args.message
result = {
permit=permit
}
postMessageDone
GS2-Script called after posting a message.
Request
| Type | Description |
---|
namespace | Namespace | Namespace |
room | Room | Room |
message | Message | Message |
Result
| Type | Require | Default | Limitation | Description |
---|
Implementation Example
namespace = args.namespace
room = args.room
message = args.message
result = {
}
subscribeRoom
Event trigger to call GS2-Script before subscribing to a room.
Request
| Type | Description |
---|
namespace | Namespace | Namespace |
room | Room | Room |
subscribe | Subscribe | Subscribe |
Result
| Type | Require | Default | Limitation | Description |
---|
permit | bool | ✓ | | | Allow room subscription |
Implementation Example
namespace = args.namespace
room = args.room
subscribe = args.subscribe
result = {
permit=permit
}
subscribeRoomDone
GS2-Script called after subscribing to a room.
Request
| Type | Description |
---|
namespace | Namespace | Namespace |
room | Room | Room |
subscribe | Subscribe | Subscribe |
Result
| Type | Require | Default | Limitation | Description |
---|
Implementation Example
namespace = args.namespace
room = args.room
subscribe = args.subscribe
result = {
}
unsubscribeRoom
Event trigger to call GS2-Script before room subscription is cancelled.
Request
| Type | Description |
---|
namespace | Namespace | Namespace |
room | Room | Room |
subscribe | Subscribe | Subscribe |
Result
| Type | Require | Default | Limitation | Description |
---|
permit | bool | ✓ | | | Allow room unsubscription |
Implementation Example
namespace = args.namespace
room = args.room
subscribe = args.subscribe
result = {
permit=permit
}
unsubscribeRoomDone
GS2-Script called after room subscription is cancelled.
Request
| Type | Description |
---|
namespace | Namespace | Namespace |
room | Room | Room |
subscribe | Subscribe | Subscribe |
Result
| Type | Require | Default | Limitation | Description |
---|
Implementation Example
namespace = args.namespace
room = args.room
subscribe = args.subscribe
result = {
}