/// <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 AutoMatch With Option Like : Min , Max , Role /// </summary> /// <param name="option">(NOTNULL)AutoMatch Option</param> public void AutoMatch(GSLiveOption.AutoMatchOption option) { if (_turnBasedListener == 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 tb = GSLiveProvider.GetGSLiveTB(); tb.Call("AutoMatch", option.MaxPlayer, option.MinPlayer, option.Role, option.IsPersist ); }
/// <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> /// If is your Turn, you can send data to other players using this function. /// Also if You Want to Move Your Turn to the Next player /// put the next player ID in the function entry /// You can use this function several times /// </summary> /// <param name="data">(NULLABLE)Room's Role </param> /// <param name="whoIsNext">(NULLABLE) Next Player's ID </param> public void TakeTurn(string data, string whoIsNext) { if (_turnBasedListener == null) { LogUtil.LogError(Tag, "Listener Must not be NULL"); return; } var tb = GSLiveProvider.GetGSLiveTB(); tb.Call("TakeTurn", data, whoIsNext); }
/// <summary> /// Leave The Current Room , if whoIsNext Set Null , Server Automatically Selects Next Turn /// </summary> /// <param name="whoIsNext">(NULLABLE)(Type : Member's ID) Player's id You Want To Select Next Turn</param> public void LeaveRoom(string whoIsNext) { if (_turnBasedListener == null) { LogUtil.LogError(Tag, "Listener Must not be NULL"); return; } var tb = GSLiveProvider.GetGSLiveTB(); tb.Call("LeaveRoom", whoIsNext); }
/// <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> /// Get Room Members Details /// </summary> public void GetRoomMembersDetail() { if (_turnBasedListener == null) { LogUtil.LogError(Tag, "Listener Must not be NULL"); return; } var tb = GSLiveProvider.GetGSLiveTB(); tb.Call("GetRoomPlayersDetail"); }
/// <summary> /// Get Your Invite Inbox /// </summary> public void GetInviteInbox() { if (_turnBasedListener == null) { LogUtil.LogError(Tag, "Listener Must not be NULL"); return; } var tb = GSLiveProvider.GetGSLiveTB(); tb.Call("GetInviteInbox"); }
/// <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> /// Join In Room With RoomID /// </summary> /// <param name="roomId">(NOTNULL)Room's id You Want To Join</param> public void JoinRoom(string roomId) { if (_turnBasedListener == null) { LogUtil.LogError(Tag, "Listener Must not be NULL"); return; } if (roomId == null) { LogUtil.LogError(Tag, "RoomId Must not be NULL"); return; } var tb = GSLiveProvider.GetGSLiveTB(); tb.Call("JoinRoom", roomId); }
/// <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 Message In SubscribedChannel. /// </summary> /// <param name="channelName">(NOTNULL)Name of Channel You want To Send Message</param> /// <param name="message">(NOTNULL)Message Data</param> public void SendChannelMessage(string channelName, string message) { if (_chatListener == null) { LogUtil.LogError(Tag, "Listener Must not be NULL"); return; } if (channelName == null || message == null) { LogUtil.LogError(Tag, "Inputs Must not be NULL"); return; } var chat = GSLiveProvider.GetGSLiveChat(); chat.Call("SendChannelMessage", channelName, message); }
/// <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 (_turnBasedListener == null) { LogUtil.LogError(Tag, "Listener Must not be NULL"); return; } if (role == null) { LogUtil.LogError(Tag, "Role Must not be NULL"); return; } var tb = GSLiveProvider.GetGSLiveTB(); tb.Call("GetAvailableRooms", role); }
/// <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> /// Subscribe In Channel With channelName. /// </summary> /// <param name="channelName">(NOTNULL)Name of Channel You want To Subscribe</param> public void SubscribeChannel(string channelName) { if (_chatListener == null) { LogUtil.LogError(Tag, "Listener Must not be NULL"); return; } if (channelName == null) { LogUtil.LogError(Tag, "channelName Must not be NULL"); return; } var chat = GSLiveProvider.GetGSLiveChat(); chat.Call("SubscribeChannel", channelName); }
/// <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 (_turnBasedListener == null) { LogUtil.LogError(Tag, "Listener Must not be NULL"); return; } if (inviteId == null) { LogUtil.LogError(Tag, "InviteID Must not be NULL"); return; } var tb = GSLiveProvider.GetGSLiveTB(); tb.Call("AcceptInvite", inviteId); }
/// <summary> /// If you want to announce the end of the game, use this function to send the result of your game to other players. /// </summary> /// <param name="outcomes">(NOTNULL) A set of players and their results</param> public void Finish(Dictionary <string, Outcome> outcomes) { if (_turnBasedListener == null) { LogUtil.LogError(Tag, "Listener Must not be NULL"); return; } if (outcomes == null) { LogUtil.LogError(Tag, "Outcomes Must not be NULL"); return; } var tb = GSLiveProvider.GetGSLiveTB(); tb.Call("Finish", JsonConvert.SerializeObject(outcomes)); }
/// <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 (_turnBasedListener == 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 tb = GSLiveProvider.GetGSLiveTB(); tb.Call("InviteUser", roomId, userId); }
/// <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> /// 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> /// If you would like to confirm one of the results posted by other Players /// </summary> /// <param name="memberId">(NOTNULL)The Specific player ID</param> public void Complete(string memberId) { if (_turnBasedListener == null) { LogUtil.LogError(Tag, "Listener Must not be NULL"); return; } if (memberId == null) { LogUtil.LogError(Tag, "MemberId Must not be NULL"); return; } var tb = GSLiveProvider.GetGSLiveTB(); tb.Call("Complete", memberId); }
/// <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 (_turnBasedListener == 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 tb = GSLiveProvider.GetGSLiveTB(); tb.Call("FindUser", query, limit); }
private static void SetEventListener(IEventListener listener) { var tb = GSLiveProvider.GetGSLiveTB(); tb.Call("SetListener", listener); }
private static void SetEventListener(IEventListener listener) { var rt = GSLiveProvider.GetGSLiveRT(); rt.Call("SetListener", listener); }
private static void SetEventListener(IChatListener listener) { var chat = GSLiveProvider.GetGSLiveChat(); chat.Call("setListener", listener); }