Created ClientLocal and BodyLocal which is where we'll track server-only
information. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5474 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// Narya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2008 Three Rings Design, Inc., All Rights Reserved
|
||||
// http://www.threerings.net/code/narya/
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
package com.threerings.crowd.server;
|
||||
|
||||
import com.threerings.presents.server.ClientLocal;
|
||||
|
||||
/**
|
||||
* Contains information tracked for each body by the server.
|
||||
*/
|
||||
public class BodyLocal extends ClientLocal
|
||||
{
|
||||
/**
|
||||
* The time at which the {@link #status} field was last updated. This is only available on the
|
||||
* server.
|
||||
*/
|
||||
public long statusTime;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public class BodyManager
|
||||
if (body.status != status) {
|
||||
// update the status in their body object
|
||||
body.setStatus(status);
|
||||
body.statusTime = System.currentTimeMillis();
|
||||
body.getLocal(BodyLocal.class).statusTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
updateOccupantInfo(body, location, new OccupantInfoOp() {
|
||||
|
||||
@@ -23,6 +23,7 @@ package com.threerings.crowd.server;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import com.threerings.presents.server.ClientLocal;
|
||||
import com.threerings.presents.server.PresentsClient;
|
||||
|
||||
import com.threerings.crowd.chat.server.SpeakUtil;
|
||||
@@ -34,6 +35,12 @@ import com.threerings.crowd.data.OccupantInfo;
|
||||
*/
|
||||
public class CrowdClient extends PresentsClient
|
||||
{
|
||||
@Override
|
||||
protected ClientLocal createLocalAttribute ()
|
||||
{
|
||||
return new BodyLocal();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sessionConnectionClosed ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user