Beispiel #1
0
    public void OnClickRequest()
    {
        int len = m_InputMessage.text.Length;

        if (len < NicknameMin || len > NicknameMax)
        {
            Tooltip.Instance.ShowMessageKey("NicknameNotAvailable");
            return;
        }

        C2G.FriendsRequestWithNickname packet = new C2G.FriendsRequestWithNickname();
        packet.nickname = m_InputMessage.text;
        Network.GameServer.JsonAsync <C2G.FriendsRequestWithNickname, C2G.FriendsAckBase>(packet, OnFriendsRequestWithNicknameHandler);
    }
Beispiel #2
0
    void OnFriendsRequestWithNicknameHandler(C2G.FriendsRequestWithNickname packet, C2G.FriendsAckBase ack)
    {
        switch (ack.result)
        {
        case pe_FriendsResult.Success:
            base.OnClose();
            if (OnSuccessCallback != null)
            {
                OnSuccessCallback(packet.nickname);
            }
            break;

        default:
            Friends.ShowFriendsErrorTooltip(ack.result);
            break;
        }
    }