From 6ee8fb646c1bf8bd33732366cd0e58a3092fb259 Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Wed, 23 Mar 2011 07:35:21 +0000 Subject: [PATCH] HostedConnection can now supply the Server instance that is hosting it. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7082 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/networking/com/jme3/network/HostedConnection.java | 5 +++++ .../networking/com/jme3/network/base/DefaultServer.java | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/engine/src/networking/com/jme3/network/HostedConnection.java b/engine/src/networking/com/jme3/network/HostedConnection.java index 8c8e50e15..6b6ebfb82 100644 --- a/engine/src/networking/com/jme3/network/HostedConnection.java +++ b/engine/src/networking/com/jme3/network/HostedConnection.java @@ -43,6 +43,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. */ diff --git a/engine/src/networking/com/jme3/network/base/DefaultServer.java b/engine/src/networking/com/jme3/network/base/DefaultServer.java index cdc156d34..11c3814ea 100644 --- a/engine/src/networking/com/jme3/network/base/DefaultServer.java +++ b/engine/src/networking/com/jme3/network/base/DefaultServer.java @@ -379,7 +379,12 @@ public class DefaultServer implements Server { id = nextId.getAndIncrement(); } - + + public Server getServer() + { + return DefaultServer.this; + } + public int getId() { return id;