Script Trigger Reference of GS2-Friend
Trigger
updateProfile
profile updates
Synchronous Execution Script
The script is executed synchronously before the profile updates process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| profile | Profile | Profile |
| oldProfile | Profile | Old Profile |
| publicProfile | string | New Public profile |
| followerProfile | string | New Profile for followers |
| friendProfile | string | New Profile for friends |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow profile updates |
Implementation Example
namespace = args.namespace
profile = args.profile
oldProfile = args.oldProfile
publicProfile = args.publicProfile
followerProfile = args.followerProfile
friendProfile = args.friendProfile
result = {
permit=permit
}Asynchronous Execution Script
The script executes asynchronously after the profile updates.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| oldProfile | Profile | Profile before update |
| profile | Profile | Profile after update |
Implementation Example
namespace = args.namespace
oldProfile = args.oldProfile
profile = args.profile
result = {
}follow
Follow
Synchronous Execution Script
The script is executed synchronously before the follow process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| followUser | FollowUser | Follow Information |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow the follow operation |
Implementation Example
namespace = args.namespace
followUser = args.followUser
result = {
permit=permit
}Asynchronous Execution Script
The script executes asynchronously after the Follow.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| followUser | FollowUser | Follow Information |
Implementation Example
namespace = args.namespace
followUser = args.followUser
result = {
}unfollow
Unfollow
Synchronous Execution Script
The script is executed synchronously before the unfollow process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| followUser | FollowUser | Follow Information |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow the unfollow operation |
Implementation Example
namespace = args.namespace
followUser = args.followUser
result = {
permit=permit
}Asynchronous Execution Script
The script executes asynchronously after the Unfollow.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| followUser | FollowUser | Follow Information |
Implementation Example
namespace = args.namespace
followUser = args.followUser
result = {
}deleteFriend
Delete friend
Synchronous Execution Script
The script is executed synchronously before the delete friend process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| userId | string | User ID |
| friendUser | FriendUser | Friend |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow Delete Friend |
Implementation Example
namespace = args.namespace
userId = args.userId
friendUser = args.friendUser
result = {
permit=permit
}Asynchronous Execution Script
The script executes asynchronously after the Delete friend.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| userId | string | User ID |
| friendUser | FriendUser | Friend |
Implementation Example
namespace = args.namespace
userId = args.userId
friendUser = args.friendUser
result = {
}sendRequest
Friend requests to be issued
Synchronous Execution Script
The script is executed synchronously before the friend requests to be issued process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| friendRequest | FriendRequest | Friend Request |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow friend requests to be issued |
Implementation Example
namespace = args.namespace
friendRequest = args.friendRequest
result = {
permit=permit
}Asynchronous Execution Script
The script executes asynchronously after the Friend requests to be issued.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| friendRequest | FriendRequest | Friend Request |
Implementation Example
namespace = args.namespace
friendRequest = args.friendRequest
result = {
}cancelRequest
Cancellation of friend request
Synchronous Execution Script
The script is executed synchronously before the cancellation of friend request process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| friendRequest | FriendRequest | Friend Request |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow cancellation of friend request |
Implementation Example
namespace = args.namespace
friendRequest = args.friendRequest
result = {
permit=permit
}Asynchronous Execution Script
The script executes asynchronously after the Cancellation of friend request.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| friendRequest | FriendRequest | Friend Request |
Implementation Example
namespace = args.namespace
friendRequest = args.friendRequest
result = {
}acceptRequest
Accepting the friend request
Synchronous Execution Script
The script is executed synchronously before the accepting the friend request process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| friendRequest | FriendRequest | Friend Request |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow accepting the friend request |
Implementation Example
namespace = args.namespace
friendRequest = args.friendRequest
result = {
permit=permit
}Asynchronous Execution Script
The script executes asynchronously after the Accepting the friend request.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| friendRequest | FriendRequest | Friend Request |
Implementation Example
namespace = args.namespace
friendRequest = args.friendRequest
result = {
}rejectRequest
Rejecting the friend request
Synchronous Execution Script
The script is executed synchronously before the rejecting the friend request process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| friendRequest | FriendRequest | Friend Request |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow rejecting the friend request |
Implementation Example
namespace = args.namespace
friendRequest = args.friendRequest
result = {
permit=permit
}Asynchronous Execution Script
The script executes asynchronously after the Rejecting the friend request.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| friendRequest | FriendRequest | Friend Request |
Implementation Example
namespace = args.namespace
friendRequest = args.friendRequest
result = {
}