Serial Codes

개요

Type a campaign code and get a reward. Enter WELCOME2026 in the field under Redeem a campaign code and press Redeem; 100 coins land in the wallet under Where the coins land. Each visitor can redeem once, and a second try or a wrong code is refused with the reason.

체험 방법

  1. Read the rule under Redeem a campaign code and the redemption status (“You have not redeemed a code yet.”).
  2. Type WELCOME2026 into the field (Type a code) and press Redeem; Free balance under Where the coins land goes up by 100.
  3. Press Redeem again; it is refused with “You have already redeemed a code; each visitor can redeem once.” and no coins are added.
  4. Press Start over to clear your redemption so you can redeem again.
  5. Type a wrong code such as welcome2026 and press Redeem; it is refused because GS2 does not know the code (codes are case sensitive).

사용하는 GS2 서비스

  • GS2-SerialKey: The GS2-SerialKey campaign WELCOME2026 is registered as a campaign code, and the redemption transaction checks the typed code against it.
  • GS2-Exchange: A GS2-Exchange rate bundles the code use, the redemption count and the coin deposit into one transaction that commits only if all succeed; Start over is another exchange rate.
  • GS2-Limit: A GS2-Limit counter (maximum 1, never resets) counts the redemption and refuses a second one; Start over deletes that counter.
  • GS2-Money2: The 100-coin reward is deposited into the GS2-Money2 wallet as free currency.

GS2 Studio에서 사용하기

GS2 Studio의 Simple 모드에서 Add features 를 열고 Serial Codes 의 Add 를 누르면 이 기능을 자신의 프로젝트에 가져올 수 있습니다. 패키지를 직접 지정하려면 Add from GitHub 를 선택하고 아래 패키지를 입력합니다.

https://github.com/gs2io/gs2-studio-package/tree/main/micro-liveops-serial-code/packages/micro-liveops-serial-code
  • Owner: gs2io
  • Repository: gs2-studio-package
  • Subdirectory: micro-liveops-serial-code/packages/micro-liveops-serial-code

소스 코드