Compare commits

...
4 Commits
Author SHA1 Message Date
Mo Firouz d771de35c1 Nakama-Java 2.0.3 release. 2019-10-25 15:38:44 +02:00
Mo Firouz 15456d4e8c Add support for more ways to create a socket. 2019-10-25 15:36:18 +02:00
Mo Firouz 2222f178a6 Fix typo in UserPresence variable naming. 2019-10-16 17:17:03 +02:00
Mo Firouz e46d122d2d Set new development version. 2019-10-14 12:16:51 +02:00
6 changed files with 54 additions and 3 deletions

No files matched your search

+7
View File
@@ -6,6 +6,13 @@ The format is based on [keep a changelog](http://keepachangelog.com/) and this p
## [Unreleased]
## [2.0.3] - 2019-10-25
### Added
- More ways to create a socket connection.
### Fixed
- Correctly decode UserPresence from payload.
## [2.0.2] - 2019-10-14
### Added
- Add support for session vars.
+1 -1
View File
@@ -36,7 +36,7 @@ plugins {
}
group = 'com.heroiclabs.nakama'
version = '2.0.2'
version = '2.0.3'
def description = 'Android optimized Java client for Nakama server.'
def gopath = System.getenv('GOPATH')
sourceCompatibility = 1.7
@@ -33,10 +33,12 @@ public class Channel {
* The server-assigned channel ID.
*/
private String id;
/**
* The presences visible on the chat channel.
*/
private List<UserPresence> presences;
/**
* The presence of the current user. i.e. Your self.
*/
@@ -60,6 +60,33 @@ public interface Client {
*/
SocketClient createSocket(final int port, final int socketTimeoutMs);
/**
* Create a new socket from the client.
* @param host The host URL of the server.
* @param port The port number of the server. Default should be 7350.
* @return a new SocketClient instance.
*/
SocketClient createSocket(final String host, final int port);
/**
* Create a new socket from the client.
* @param host The host URL of the server.
* @param port The port number of the server. Default should be 7350.
* @param ssl Whether to use SSL to connect to the server.
* @return a new SocketClient instance.
*/
SocketClient createSocket(final String host, final int port, final boolean ssl);
/**
* Create a new socket from the client.
* @param host The host URL of the server.
* @param port The port number of the server. Default should be 7350.
* @param ssl Whether to use SSL to connect to the server.
* @param socketTimeoutMs Sets the connect, read and write timeout for new connections.
* @return a new SocketClient instance.
*/
SocketClient createSocket(final String host, final int port, final boolean ssl, final int socketTimeoutMs);
/**
* Add one or more friends by id.
* @param session The session of the user.
@@ -166,11 +166,26 @@ public class DefaultClient implements Client {
return createSocket(port, 5000);
}
@Override
public SocketClient createSocket(final String host, final int port) {
return createSocket(host, port, ssl);
}
@Override
public SocketClient createSocket(final int port, final int socketTimeoutMs) {
return new WebSocketClient(host, port, ssl, socketTimeoutMs, this.trace);
}
@Override
public SocketClient createSocket(final String host, final int port, final boolean ssl) {
return new WebSocketClient(host, port, ssl, 5000, this.trace);
}
@Override
public SocketClient createSocket(final String host, final int port, final boolean ssl, final int socketTimeoutMs) {
return new WebSocketClient(host, port, ssl, socketTimeoutMs, this.trace);
}
@Override
public ListenableFuture<Empty> addFriends(@NonNull final Session session, @NonNull final String... ids) {
return getStub(session).addFriends(AddFriendsRequest.newBuilder().addAllIds(Arrays.asList(ids)).build());
@@ -46,7 +46,7 @@ public class MatchData {
/**
* Information on the user who sent the state change.
*/
private UserPresence userPresence;
private UserPresence presence;
/**
* Returns match data
@@ -62,5 +62,5 @@ public class MatchData {
/**
* True if this data was delivered reliably, false otherwise.
*/
private Boolean reliable;
private boolean reliable;
}