Example #1
0
        public int SetConnectToChannelCallback(Session.ConnectToChannelDelegate callback)
        {
            if (null == callback)
            {
                return(0);
            }

            int handlerNum = CallbackManager.AddHandler(delegate(CallbackMessage message)
            {
                Log.Debug("[SessionCallback] ConnectToChannelCallback: " + message.ToString());

                Result result = message.GetResult();

                List <ChannelConnectOption> channelConnectOptionList = null;
                IList optionList = message.GetList("channelConnectOptionList");
                if (null != optionList)
                {
                    channelConnectOptionList = new List <ChannelConnectOption>();
                    foreach (IDictionary option in optionList)
                    {
                        int type         = option.GetInt("type");
                        string playerId  = option.GetString("playerId");
                        int channelCode  = option.GetInt("channelCode");
                        string channelId = option.GetString("channelId");
                        string region    = option.GetString("region");

                        ChannelConnectOption channelConnectOption = new ChannelConnectOption((ChannelConnectOptionType)type, playerId, channelCode, channelId, region);
                        channelConnectOptionList.Add(channelConnectOption);
                    }
                }

                if (null != callback)
                {
                    callback(result, channelConnectOptionList);
                }
            });

            return(handlerNum);
        }
Example #2
0
 /**
  * @brief Connect to channel by force.<br>
  * After signing in, player who has playerId connect with channelId.
  * if you get option list, use this API function to select option.
  *
  * @param option Option.
  * @param callback Callback to deal with a reponse to the request.
  * @see SelectChannelConnectOptionDelegate
  * @see ChannelConnectOption
  */
 public void SelectChannelConnectOption(ChannelConnectOption option, SelectChannelConnectOptionDelegate callback)
 {
     Log.Debug("[Session] SelectChannelConnectOption");
     SessionImpl.SelectChannelConnectOption(option, callback);
 }
        public void SelectChannelConnectOption(ChannelConnectOption option, Session.SelectChannelConnectOptionDelegate callback)
        {
            int handlerNum = sessionCallback.SetSelectChannelConnectOptionCallback(callback);

            nmg_session_selectChannelConnectOption((int)option.Type, option.ChannelCode, option.PlayerID, option.ChannelID, option.Region, handlerNum);
        }
Example #4
0
 public void SelectChannelConnectOption(ChannelConnectOption option, Session.SelectChannelConnectOptionDelegate callback)
 {
     SessionManager.Instance.SelectChannelConnectOption(option, callback);
 }
 public void SelectChannelConnectOption(ChannelConnectOption option, Session.SelectChannelConnectOptionDelegate callback)
 {
 }