C# Client APIs
- Initialize
- Connect
- setRecoveryAllowance
- RecoverConnection
- Disconnect
- GetConnectionState
- JoinLobby
- LeaveLobby
- SubscribeLobby
- UnSubscribeLobby
- JoinRoom
- JoinRoomWithNUser
- JoinRoomInRange
- GetRoomsInRange
- JoinRoomWithProperties
- startGame
- invokeZoneRPC
- CreateTurnRoom
- SendMove
- DeleteRoom
- SubscribeRoom
- UnSubscribeRoom
- SendChat
- SendPrivateChat
- SendUpdatePeers
- GetLiveRoomInfo
- GetLiveUserInfo
- GetLiveLobbyInfo
- SetCustomUserData
- SetCustomRoomData
- UpdateRoomProperties
- LeaveRoom
- stopGame
- invokeRoomRPC
- LockProperties
- UnlockProperties
- GetOnlineUsers
- GetRoomWithNUser
- GetRoomWithProperties
- GetAllRooms
- AddConnectionRequestListener
- AddRoomRequestListener
- AddZoneRequestListener
- AddLobbyRequestListener
- AddNotificationListener
- AddUpdateRequestListener
- AddChatRequestListener
- AddTurnBasedRoomRequestListener
- CreateRoom
- getMoveHistory
public static void Initialize(String appKey, String s2Address)
appKey - The Application key of the zone its created from the admin dashboard. s2Address - The IP address of the server where the AppWarp S2 zone is hosted.
void
public void setRecoveryAllowance(int maxRecoveryTime)
maxRecoveryTime - time - the time (in seconds) allowed to the client to recover from intermittent connection loss Returns void
public void RecoverConnection()
void
public void Connect(String username, String authData)
username - name of the player authData - custom data for validation by the zone adaptor on the server Returns void
public void Disconnect()
void
public byte GetConnectionState()
byte
public void JoinLobby()
void
public void LeaveLobby()
void
public void SubscribeLobby()
void
public void UnsubscribeLobby()
void
public void JoinRoom(String roomId)
roomId - Id of the room to be joined Returns void
public void JoinRoomInRange(int minUserCount, int maxUserCount, bool maxPreferred)
minUserCount - minimum users in the room maxUserCount - maximum users in the room maxPreferred - prefer joining a room with more users Returns void
public void GetRoomsInRange(int minUserCount, int maxUserCount)
minUserCount - minimum users in the room maxUserCount - maximum users in the room Returns void
public void JoinRoomWithNUser(int userCount)
userCount- minimum number of users in room Returns void
public void JoinRoomWithProperties(Dictionary<String, Object> tableProperties)
tableProperties- properties of the room to be joined Returns void
public void LeaveRoom(String roomId)
roomId - Id of the room to be left Returns void
public void CreateRoom(String name, String owner, int maxUsers, Dictionary<String, Object> tableProperties)
name - name of the room owner - owner of the room (behavior and usage of this meta property is up to the developer) maxUsers - number of maximum users allowed in the room tableProperties - properties of room (can be null)
void
public void CreateTurnRoom(String name, String owner, int maxUsers, Dictionary<String, Object> tableProperties, int turnTime)
name - name of the room owner - owner of the room (behavior and usage of this meta property is up to the developer) maxUsers - number of maximum users allowed in the room tableProperties - properties of room (can be null) turnTime - the time (in seconds) allowed for a user to complete its turn and send a move.
void
public void sendMove(String moveData)
moveData - any meta data associated with the move
void
public void DeleteRoom(String roomId)
roomId - Id of the room to be deleted Returns void
public void SubscribeRoom(String roomId)
roomId - Id of the room to be subscribed Returns
public void UnSubscribeRoom(String roomId)
roomId - Id of the room to be unsubscribed Returns void
public void SendChat(String message)
message - message to be send Returns void
public void sendPrivateChat(String username, String message)
username - recipient of the message message - message to be send Returns void
public void SendUpdatePeers(byte[] update)
update - byte array data to be sent Returns void
public void GetLiveRoomInfo(String roomId)
roomId - Id of the room Returns void
public void GetLiveUserInfo(String username)
username - user who's information is requested Returns void
public void GetLiveLobbyInfo()
void
public void SetCustomUserData(String userName, String customData)
userName - user for whom custom data has to be update customData - custom data that will be set for the user
void
public void SetCustomRoomData(String roomId, String customRoomData)
roomId - Id of the room customRoomData - custom data that will be set for the room
void
public void UpdateRoomProperties(String roomID, Dictionary<String, Object> tableProperties, List<String> removeList)
roomId - Id of the room tableProperties- Properties of the room to be added or updated. removeList - List of properties to be removed.
void
public void LockProperties(Dictionary<String, Object> lockedProperties)
lockedProperties - dictionary of keys and their values to be locked for the user
void
public void UnlockProperties(List<String> properties)
properties - list of keys to be unlocked for the user
void
public void GetOnlineUsers()
void
public void GetAllRooms()
void
public void GetRoomWithNUser(int userCount)
userCount - No of user in room Returns void
public void GetRoomWithProperties(Dictionary<String, Object> properties)
properties- Properties of the room to be matched Returns void
public void AddConnectionRequestListener(ConnectionRequestListener listner)
listener - listener object Returns void
public void AddRoomRequestListener(RoomRequestListener listner)
listener - listener object Returns void
public void AddZoneRequestListener(ZoneRequestListener listner)
listener - listener object Returns void
public void AddLobbyRequestListener(LobbyRequestListener listner)
listener - listener object Returns void
public void AddNotificationListener(NotifyListener listner)
listener - listener object Returns void
public void AddUpdateRequestListener(UpdateRequestListener listener)
listener - listener object Returns void
public void AddChatRequestListener(ChatRequestListenerlistener listener)
listener - listener object Returns void
public void AddTurnBasedRoomRequestListener(TurnBasedRoomListener listener)
listener - listener object Returns void
public void startGame()
void
public void stopGame()
void
public void getMoveHistory()
result-byte history-MoveEvent[] Returns void
public void invokeZoneRPC(string func, params object[] args)
func - name of the function to be invoked args - arguments to be passed to the function Returns
void
public void invokeRoomRPC(string roomId, string func, params object[] args)
roomId - roomId of the room adaptor func - name of the function to be invoked args - arguments to be passed to the function Returns
void























