OSDN Git Service

HostedConnection can now supply the Server instance
authorPSpeed42@gmail.com <PSpeed42@gmail.com@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Wed, 23 Mar 2011 07:35:21 +0000 (07:35 +0000)
committerPSpeed42@gmail.com <PSpeed42@gmail.com@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Wed, 23 Mar 2011 07:35:21 +0000 (07:35 +0000)
that is hosting it.

git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@7082 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

engine/src/networking/com/jme3/network/HostedConnection.java
engine/src/networking/com/jme3/network/base/DefaultServer.java

index 8c8e50e..6b6ebfb 100644 (file)
@@ -44,6 +44,11 @@ import java.util.Set;
 public interface HostedConnection extends MessageConnection
 {
     /**
+     *  Returns the Server instance that is hosting this connection.
+     */
+    public Server getServer();     
+
+    /**
      *  Returns the server-unique ID for this client.
      */
     public int getId();
index cdc156d..11c3814 100644 (file)
@@ -379,7 +379,12 @@ public class DefaultServer implements Server
         {
             id = nextId.getAndIncrement();
         }
-        
+        public Server getServer()
+        {   
+            return DefaultServer.this;
+        }     
+       
         public int getId()
         {
             return id;