コード例 #1
0
        /// <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
                    );
        }
コード例 #2
0
        /// <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
                    );
        }
コード例 #3
0
        /// <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");
        }
コード例 #4
0
        /// <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");
        }
コード例 #5
0
        /// <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");
        }
コード例 #6
0
        /// <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);
        }
コード例 #7
0
        /// <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);
        }
コード例 #8
0
        /// <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);
        }
コード例 #9
0
        /// <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);
        }
コード例 #10
0
        /// <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);
        }
コード例 #11
0
        /// <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);
        }
コード例 #12
0
        /// <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);
        }
コード例 #13
0
        private static void SetEventListener(IEventListener listener)
        {
            var rt = GSLiveProvider.GetGSLiveRT();

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