Trigger Reference of GS2-Friend Script

updateProfile

Event trigger to call GS2-Script before profile is updated.

Request

TypeDescription
namespaceNamespaceNamespace
profileProfileProfile
oldProfileProfileOld Profile
publicProfilestringNew Public profile
followerProfilestringNew Profile for followers
friendProfilestringNew Profile for friends

Result

TypeRequireDefaultLimitationDescription
permitboolAllow profile update

Implementation Example

namespace = args.namespace
profile = args.profile
oldProfile = args.oldProfile
publicProfile = args.publicProfile
followerProfile = args.followerProfile
friendProfile = args.friendProfile

result = {
  permit=permit
}

updateProfileDone

GS2-Script called after profile is updated.

Request

TypeDescription
namespaceNamespaceNamespace
oldProfileProfileProfile before update
profileProfileProfile after update

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
oldProfile = args.oldProfile
profile = args.profile

result = {
}

follow

Event trigger to call GS2-Script before follow-up.

Request

TypeDescription
namespaceNamespaceNamespace
followUserFollowUserFollow Information

Result

TypeRequireDefaultLimitationDescription
permitboolAllow follow

Implementation Example

namespace = args.namespace
followUser = args.followUser

result = {
  permit=permit
}

followDone

GS2-Script called after follow-up.

Request

TypeDescription
namespaceNamespaceNamespace
followUserFollowUserFollow Information

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
followUser = args.followUser

result = {
}

unfollow

Event trigger to call GS2-Script before unfollowing.

Request

TypeDescription
namespaceNamespaceNamespace
followUserFollowUserFollow Information

Result

TypeRequireDefaultLimitationDescription
permitboolAllow Unfollow

Implementation Example

namespace = args.namespace
followUser = args.followUser

result = {
  permit=permit
}

unfollowDone

GS2-Script called after unfollowing.

Request

TypeDescription
namespaceNamespaceNamespace
followUserFollowUserFollow Information

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
followUser = args.followUser

result = {
}

deleteFriend

Event trigger to call GS2-Script before a friend is deleted.

Request

TypeDescription
namespaceNamespaceNamespace
friendUserFriendUserFriend

Result

TypeRequireDefaultLimitationDescription
permitboolAllow Delete Friend

Implementation Example

namespace = args.namespace
friendUser = args.friendUser

result = {
  permit=permit
}

deleteFriendDone

GS2-Script called after a friend is deleted.

Request

TypeDescription
namespaceNamespaceNamespace
friendUserFriendUserFriend

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
friendUser = args.friendUser

result = {
}

sendRequest

Event trigger to call GS2-Script before Issue a friend request.

Request

TypeDescription
namespaceNamespaceNamespace
friendRequestFriendRequestFriend Request

Result

TypeRequireDefaultLimitationDescription
permitboolAllow friend requests to be issued

Implementation Example

namespace = args.namespace
friendRequest = args.friendRequest

result = {
  permit=permit
}

sendRequestDone

GS2-Script called after Issue a friend request.

Request

TypeDescription
namespaceNamespaceNamespace
friendRequestFriendRequestFriend Request

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
friendRequest = args.friendRequest

result = {
}

cancelRequest

Event trigger to call GS2-Script before cancel a friend request.

Request

TypeDescription
namespaceNamespaceNamespace
friendRequestFriendRequestFriend Request

Result

TypeRequireDefaultLimitationDescription
permitboolAllow cancellation of friend request

Implementation Example

namespace = args.namespace
friendRequest = args.friendRequest

result = {
  permit=permit
}

cancelRequestDone

GS2-Script called after cancel a friend request.

Request

TypeDescription
namespaceNamespaceNamespace
friendRequestFriendRequestFriend Request

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
friendRequest = args.friendRequest

result = {
}

acceptRequest

Event trigger to call GS2-Script before a friend request is accepted.

Request

TypeDescription
namespaceNamespaceNamespace
friendRequestFriendRequestFriend Request

Result

TypeRequireDefaultLimitationDescription
permitboolAccept friend request Allow

Implementation Example

namespace = args.namespace
friendRequest = args.friendRequest

result = {
  permit=permit
}

acceptRequestDone

GS2-Script called after a friend request is accepted.

Request

TypeDescription
namespaceNamespaceNamespace
friendRequestFriendRequestFriend Request

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
friendRequest = args.friendRequest

result = {
}

rejectRequest

Event trigger to call GS2-Script before a friend request is rejected.

Request

TypeDescription
namespaceNamespaceNamespace
friendRequestFriendRequestFriend Request

Result

TypeRequireDefaultLimitationDescription
permitboolAllow or deny friend request

Implementation Example

namespace = args.namespace
friendRequest = args.friendRequest

result = {
  permit=permit
}

rejectRequestDone

GS2-Script called after a friend request is rejected.

Request

TypeDescription
namespaceNamespaceNamespace
friendRequestFriendRequestFriend Request

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
friendRequest = args.friendRequest

result = {
}