Trigger Reference of GS2-Grade Script

Reference for event triggers that call extended scripts, as defined in GS2-Grade

changeGrade

Event trigger to call GS2-Script before grade changes.

Request

TypeDescription
namespaceNamespaceNamespace
gradeModelGradeModelGrade Model
statusStatusStatus before change
afterStatusStatusStatus after change

Result

TypeRequireDefaultLimitationDescription
permitboolAllow grade change
overrideGradeValuelong~ 2147483645Amount of grade change

Implementation Example

namespace = args.namespace
gradeModel = args.gradeModel
status = args.status
afterStatus = args.afterStatus

result = {
  permit=permit,
  overrideGradeValue=overrideGradeValue
}

changeGradeDone

GS2-Script called after grade changes.

Request

TypeDescription
namespaceNamespaceNamespace
gradeModelGradeModelGrade Model
statusStatusStatus
afterStatusStatusStatus after change

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
gradeModel = args.gradeModel
status = args.status
afterStatus = args.afterStatus

result = {
}