본문으로 건너뛰기

아이템 지급

플레이어 우편함에 아이템을 지급 합니다.

호출 정보

// 자신의 우편함에 아이템을 지급하는 경우 
public void SendItem (string tableCode, List<ItemValueModel> items, List<MessageValueModel> messages, int period, PlayNANOODelegate callback);

// 다른 플레이어 우편함에 아이템을 지급(선물) 하는 경우
public void SendItemPlayer (string tableCode, string playerId, List<ItemValueModel> items, List<MessageValueModel> messages, int period, PlayNANOODelegate callback);

호출 상세 정보

파라미터설명타입
tableCode테이블 코드string
playerId플레이어 식별 아이디string
items지급 아이템 정보List<PlayNANOO.Inbox.ItemValueModel>
messages아이템 메시지 정보. 메시지 정보 입력 시 기본 언어 (Configure.PN_LANG_CODE_DEFAULT)는 필수입니다.List<PlayNANOO.Inbox.MessageValueModel>
period아이템 보유 기간. 아이템 보유 기간은 일단위 입니다.integer
callback통신 결과PlayNANOODelegate

소스 코드

using PlayNANOO;

public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;

void Awake()
{
plugin = Plugin.GetInstance();
}

// 자신의 우편함에 아이템을 지급하는 경우
public void ItemSend()
{
string tableCode = "TABLE_CODE";
int period = 365;

List<PlayNANOO.Inbox.ItemValueModel> items = new List<PlayNANOO.Inbox.ItemValueModel>();
List<PlayNANOO.Inbox.MessageValueModel> messages = new List<PlayNANOO.Inbox.MessageValueModel>();

items.Add(new PlayNANOO.Inbox.ItemValueModel { item_code = "ITEM_CODE_1", item_count = 10 });
items.Add(new PlayNANOO.Inbox.ItemValueModel { item_code = "ITEM_CODE_2", item_count = 20 });

// 기본 언어 Configure.PN_LANG_CODE_DEFAULT 는 필수 입니다.
messages.Add(new PlayNANOO.Inbox.MessageValueModel { language = Configure.PN_LANG_CODE_DEFAULT, title = "TEST", content = "TEST" });
messages.Add(new PlayNANOO.Inbox.MessageValueModel { language = Configure.PN_LANG_CODE_KO, title = "TEST", content = "TEST" });

plugin.InboxManager.SendItem(tableCode, items, messages, period, (status, error, jsonString, values) =>
{
if(state.Equals(Configure.PN_API_STATE_SUCCESS)) {
Debug.Log("Success");
} else {
Debug.Log("Fail");
}
});
}

// 다른 플레이어 우편함에 아이템을 지급(선물) 하는 경우
public void ItemSendPlayer()
{
string tableCode = "TABLE_CODE";
string playerId = "PLAYER_ID";
int period = 365;

List<PlayNANOO.Inbox.ItemValueModel> items = new List<PlayNANOO.Inbox.ItemValueModel>();
List<PlayNANOO.Inbox.MessageValueModel> messages = new List<PlayNANOO.Inbox.MessageValueModel>();

items.Add(new PlayNANOO.Inbox.ItemValueModel { item_code = "ITEM_CODE_1", item_count = 10 });
items.Add(new PlayNANOO.Inbox.ItemValueModel { item_code = "ITEM_CODE_2", item_count = 20 });

// 기본 언어 Configure.PN_LANG_CODE_DEFAULT 는 필수 입니다.
messages.Add(new PlayNANOO.Inbox.MessageValueModel { language = Configure.PN_LANG_CODE_DEFAULT, title = "TEST", content = "TEST" });
messages.Add(new PlayNANOO.Inbox.MessageValueModel { language = Configure.PN_LANG_CODE_KO, title = "TEST", content = "TEST" });

plugin.InboxManager.SendItemPlayer(tableCode, playerId, items, messages, period, (status, error, jsonString, values) =>
{
if(state.Equals(Configure.PN_API_STATE_SUCCESS)) {
Debug.Log("Success");
} else {
Debug.Log("Fail");
}
});
}
}

통신 결과

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"status": "success"
}

통신 결과 상세 정보

데이터키설명타입
status처리 결과string