/// <summary>
        /// Create AutoMatch With Option Like :  Min , Max , Role
        /// </summary>
        /// <param name="option">(NOTNULL)AutoMatch Option</param>
        public void AutoMatch(GSLiveOption.AutoMatchOption option)
        {
            if (_realTimeListener == null)
            {
                LogUtil.LogError(Tag, "Listener Must not be NULL");
                return;
            }

            if (option == null)
            {
                LogUtil.LogError(Tag, "Option Must not be NULL");
                return;
            }

            if (option.MinPlayer < 2 || option.MaxPlayer > 8)
            {
                LogUtil.LogError(Tag, "Min Player Must grater than 2 , Max Player Must less than 8");
                return;
            }

            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("AutoMatch",
                    option.MaxPlayer,
                    option.MinPlayer,
                    option.Role
                    );
        }
        /// <summary>
        /// Create Room With Option Like : Name , Min , Max , Role , IsPrivate
        /// </summary>
        /// <param name="option">(NOTNULL)Create Room Option</param>
        public void CreateRoom(GSLiveOption.CreateRoomOption option)
        {
            if (_realTimeListener == null)
            {
                LogUtil.LogError(Tag, "Listener Must not be NULL");
                return;
            }

            if (option == null)
            {
                LogUtil.LogError(Tag, "Option Must not be NULL");
                return;
            }

            if (option.MinPlayer < 2 || option.MaxPlayer > 8)
            {
                LogUtil.LogError(Tag, "Min Player Must grater than 2 , Max Player Must less than 8");
                return;
            }

            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("CreateRoom",
                    option.RoomName,
                    option.MaxPlayer,
                    option.MinPlayer,
                    option.Role,
                    option.IsPrivate
                    );
        }
        /// <summary>
        /// Get Your Invite Inbox
        /// </summary>
        public void GetInviteInbox()
        {
            if (_realTimeListener == null)
            {
                LogUtil.LogError(Tag, "Listener Must not be NULL");
                return;
            }

            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("GetInviteInbox");
        }
        /// <summary>
        /// Get Room Members Details
        /// </summary>
        public void GetRoomMembersDetail()
        {
            if (_realTimeListener == null)
            {
                LogUtil.LogError(Tag, "Listener Must not be NULL");
                return;
            }

            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("GetPlayersDetail");
        }
        /// <summary>
        /// Leave The Current Room
        /// </summary>
        public void LeaveRoom()
        {
            if (_realTimeListener == null)
            {
                LogUtil.LogError(Tag, "Listener Must not be NULL");
                return;
            }

            IsAvailable = false;
            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("LeaveRoom");
        }
        /// <summary>
        /// Accept a Specific Invite With Invite ID
        /// Note: After accepting the invitation, you will be automatically entered into the game room
        /// </summary>
        /// <param name="inviteId">(NOTNULL) (Type : InviteID) Invite's ID</param>
        public void AcceptInvite(string inviteId)
        {
            if (_realTimeListener == null)
            {
                LogUtil.LogError(Tag, "Listener Must not be NULL");
                return;
            }

            if (inviteId == null)
            {
                LogUtil.LogError(Tag, "InviteID Must not be NULL");
                return;
            }

            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("AcceptInvite", inviteId);
        }
        /// <summary>
        /// Invite a Specific Player To Specific Room
        /// </summary>
        /// <param name="roomId">(NOTNULL) (Type : RoomID)Room's ID</param>
        /// <param name="userId">(NOTNULL) (Type : UserID)User's ID</param>
        public void InviteUser(string roomId, string userId)
        {
            if (_realTimeListener == null)
            {
                LogUtil.LogError(Tag, "Listener Must not be NULL");
                return;
            }

            if (roomId == null || userId == null)
            {
                LogUtil.LogError(Tag, "Inputs Must not be NULL");
                return;
            }

            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("InviteUser", roomId, userId);
        }
        /// <summary>
        /// Get Available Rooms According To Room's Role
        /// </summary>
        /// <param name="role">(NOTNULL)Room's Role </param>
        public void GetAvailableRooms(string role)
        {
            if (_realTimeListener == null)
            {
                LogUtil.LogError(Tag, "Listener Must not be NULL");
                return;
            }

            if (role == null)
            {
                LogUtil.LogError(Tag, "Role Must not be NULL");
                return;
            }

            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("GetAvailableRooms", role);
        }
        /// <summary>
        /// Join In Room With RoomID
        /// </summary>
        /// <param name="roomId">(NOTNULL)Room's id You Want To Join</param>
        public void JoinRoom(string roomId)
        {
            if (_realTimeListener == null)
            {
                LogUtil.LogError(Tag, "Listener Must not be NULL");
                return;
            }

            if (roomId == null)
            {
                LogUtil.LogError(Tag, "RoomId Must not be NULL");
                return;
            }

            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("JoinRoom", roomId);
        }
        /// <summary>
        /// Send A Data To Specific Player in Room.
        /// </summary>
        /// <param name="receiverId">(NOTNULL) (Type : MemberID)Player's ID</param>
        /// <param name="data">(NOTNULL) Data for Send</param>
        public void SendPrivateMessage(string receiverId, string data)
        {
            if (_realTimeListener == null)
            {
                LogUtil.LogError(Tag, "Listener Must not be NULL");
                return;
            }

            if (receiverId == null || data == null)
            {
                LogUtil.LogError(Tag, "Inputs Must not be NULL");
                return;
            }


            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("SendPrivateMessage", receiverId, data);
        }
        /// <summary>
        /// Send A Data To All Players in Room.
        /// </summary>
        /// <param name="data">(NOTNULL) Data To BroadCast </param>
        public void SendPublicMessage(string data)
        {
            if (_realTimeListener == null)
            {
                LogUtil.LogError(Tag, "Listener Must not be NULL");
                return;
            }

            if (data == null)
            {
                LogUtil.LogError(Tag, "Data Must not be NULL");
                return;
            }


            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("SendPublicMessage", data);
        }
        /// <summary>
        /// Find All Users With Specific NickName
        /// </summary>
        /// <param name="query">(NOTNULL) Player's NickName</param>
        /// <param name="limit">(Max = 15) The Result Limits</param>
        public void FindUser(string query, int limit)
        {
            if (_realTimeListener == null)
            {
                LogUtil.LogError(Tag, "Listener Must not be NULL");
                return;
            }

            if (query == null)
            {
                LogUtil.LogError(Tag, "Query Must not be NULL");
                return;
            }

            if (limit < 0)
            {
                LogUtil.LogError(Tag, "Limit Must be Positive");
                return;
            }

            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("FindUser", query, limit);
        }
        private static void SetEventListener(IEventListener listener)
        {
            var rt = GSLiveProvider.GetGSLiveRT();

            rt.Call("SetListener", listener);
        }