Added the disconnect message which kicking a client
from the new server... haven't actually tested it. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7014 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
5adecf2aa3
commit
6718c7d892
@ -41,6 +41,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||||||
import com.jme3.network.*;
|
import com.jme3.network.*;
|
||||||
import com.jme3.network.kernel.*;
|
import com.jme3.network.kernel.*;
|
||||||
import com.jme3.network.message.ClientRegistrationMessage; //hopefully temporary
|
import com.jme3.network.message.ClientRegistrationMessage; //hopefully temporary
|
||||||
|
import com.jme3.network.message.DisconnectMessage; //hopefully temporary
|
||||||
import com.jme3.network.serializing.Serializer;
|
import com.jme3.network.serializing.Serializer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -352,7 +353,16 @@ public class DefaultServer implements Server
|
|||||||
public void close( String reason )
|
public void close( String reason )
|
||||||
{
|
{
|
||||||
// Send a reason
|
// Send a reason
|
||||||
|
DisconnectMessage m = new DisconnectMessage();
|
||||||
|
m.setType( DisconnectMessage.KICK );
|
||||||
|
m.setReason( reason );
|
||||||
|
m.setReliable( true );
|
||||||
|
send( m );
|
||||||
|
|
||||||
|
// Note: without a way to flush the pending messages
|
||||||
|
// during close, the above message may never
|
||||||
|
// go out.
|
||||||
|
|
||||||
// Just close the reliable endpoint
|
// Just close the reliable endpoint
|
||||||
// fast will be cleaned up as a side-effect
|
// fast will be cleaned up as a side-effect
|
||||||
if( reliable != null ) {
|
if( reliable != null ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user