no commit message
This commit is contained in:
@@ -22,7 +22,7 @@ import com.corundumstudio.socketio.SocketIOServer;
|
|||||||
import com.corundumstudio.socketio.annotation.SpringAnnotationScanner;
|
import com.corundumstudio.socketio.annotation.SpringAnnotationScanner;
|
||||||
|
|
||||||
@org.springframework.context.annotation.Configuration
|
@org.springframework.context.annotation.Configuration
|
||||||
public class IMServerConfiguration
|
public class GameServerConfiguration
|
||||||
{
|
{
|
||||||
@Value("${uk.im.server.host}")
|
@Value("${uk.im.server.host}")
|
||||||
private String host;
|
private String host;
|
||||||
@@ -76,7 +76,8 @@ public class IMServerConfiguration
|
|||||||
// config.setStoreFactory(new HazelcastStoreFactory());
|
// config.setStoreFactory(new HazelcastStoreFactory());
|
||||||
config.setAuthorizationListener(new AuthorizationListener() {
|
config.setAuthorizationListener(new AuthorizationListener() {
|
||||||
public boolean isAuthorized(HandshakeData data) {
|
public boolean isAuthorized(HandshakeData data) {
|
||||||
return true;
|
String token = data.getSingleUrlParam("token") ;
|
||||||
|
return !StringUtils.isBlank(token);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return server = new SocketIOServer(config);
|
return server = new SocketIOServer(config);
|
||||||
@@ -23,9 +23,8 @@ public class SystemEventHandler
|
|||||||
public void onConnect(SocketIOClient client)
|
public void onConnect(SocketIOClient client)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
String user = client.getHandshakeData().getSingleUrlParam("userid") ;
|
String token = client.getHandshakeData().getSingleUrlParam("token") ;
|
||||||
|
if(!StringUtils.isBlank(token)){
|
||||||
if(!StringUtils.isBlank(user)){
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user