Exemplo n.º 1
0
        public int SetGetWorldsAllowPushNotificationCallback(Push.GetWorldsAllowPushNotificationDelegate callback)
        {
            if (null == callback)
            {
                return(0);
            }

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

                Result result = message.GetResult();

                List <WorldAllowPushNotification> worldAllowPushNotificationList = null;
                IList worldAllowList = message.GetList("worldAllowPushNotificationList");
                if (null != worldAllowList)
                {
                    worldAllowPushNotificationList = new List <WorldAllowPushNotification>();
                    foreach (IDictionary worldAllow in worldAllowList)
                    {
                        string worldId  = worldAllow.GetString("worldId");
                        int notice      = worldAllow.GetInt("notice");
                        int game        = worldAllow.GetInt("game");
                        int nightNotice = worldAllow.GetInt("nightNotice");

                        WorldAllowPushNotification worldAllowPushNotification = new WorldAllowPushNotification(worldId, (AllowPushNotification)notice, (AllowPushNotification)game, (AllowPushNotification)nightNotice);
                        worldAllowPushNotificationList.Add(worldAllowPushNotification);
                    }
                }
                //List<object> worldAllowList = message.GetList("worldAllowPushNotificationList");
                //if (null != worldAllowList)
                //{
                //    worldAllowPushNotificationList = new List<WorldAllowPushNotification>();
                //    foreach (Dictionary<string, object> worldAllow in worldAllowList)
                //    {
                //        string worldId = System.Convert.ToString(worldAllow.GetValue("worldId"));
                //        int notice = System.Convert.ToInt32(worldAllow.GetValue("notice"));
                //        int game = System.Convert.ToInt32(worldAllow.GetValue("game"));
                //        int nightNotice = System.Convert.ToInt32(worldAllow.GetValue("nightNotice"));

                //        WorldAllowPushNotification worldAllowPushNotification = new WorldAllowPushNotification(worldId, (AllowPushNotification)notice, (AllowPushNotification)game, (AllowPushNotification)nightNotice);
                //        worldAllowPushNotificationList.Add(worldAllowPushNotification);
                //    }
                //}


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

            return(handlerNum);
        }
Exemplo n.º 2
0
        public void GetWorldsAllowPushNotification(Push.GetWorldsAllowPushNotificationDelegate callback)
        {
            int handlerNum = pushCallback.SetGetWorldsAllowPushNotificationCallback(callback);

            pushAndroidClass.CallStatic("nmg_push_getWorldsAllowPushNotification", handlerNum);
        }
Exemplo n.º 3
0
        public void GetWorldsAllowPushNotification(Push.GetWorldsAllowPushNotificationDelegate callback)
        {
            int handlerNum = pushCallback.SetGetWorldsAllowPushNotificationCallback(callback);

            nmg_push_getWorldsAllowPushNotification(handlerNum);
        }
Exemplo n.º 4
0
 public void GetWorldsAllowPushNotification(Push.GetWorldsAllowPushNotificationDelegate callback)
 {
 }