As much fun as it is to have a function named fuckingCompiler(), let's have the

services that require the use of an otherwise unreferenced class or symbol take
care of referencing that class or symbol themselves, so that if you use
LocationDirector, say, all the needed classes are properly included.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5120 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-05-22 15:17:21 +00:00
parent da9d8701c2
commit 64f68e6c63
4 changed files with 59 additions and 2 deletions
@@ -51,6 +51,7 @@ import com.threerings.crowd.data.PlaceObject;
import com.threerings.crowd.util.CrowdContext;
import com.threerings.crowd.chat.data.ChatCodes;
import com.threerings.crowd.chat.data.ChatMarshaller;
import com.threerings.crowd.chat.data.ChatMessage;
import com.threerings.crowd.chat.data.SystemMessage;
import com.threerings.crowd.chat.data.TellFeedbackMessage;
@@ -97,6 +98,9 @@ public class ChatDirector extends BasicDirector
registerCommandHandler(msg, "think", new ThinkHandler());
// registerCommandHandler(msg, "tell", new TellHandler());
registerCommandHandler(msg, "broadcast", new BroadcastHandler());
// ensure that the compiler includes these necessary symbols
var i :int = ChatMarshaller.AWAY;
}
/**
@@ -0,0 +1,46 @@
//
// $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.client {
import com.threerings.presents.client.Client;
import com.threerings.presents.net.Credentials;
import com.threerings.crowd.data.BodyMarshaller;
import com.threerings.crowd.data.CrowdPermissionPolicy;
/**
* Users of the Crowd services should extend this client so that it can ensure that certain
* ActionScript classes that will arrive over the wire as a result of using basic Crowd services
* will be included in the client.
*/
public class CrowdClient extends Client
{
public function CrowdClient (creds :Credentials)
{
super(creds);
// ensure that the compiler includes these necessary symbols
var i :int = BodyMarshaller.SET_IDLE;
var c :Class = CrowdPermissionPolicy;
}
}
}
@@ -39,6 +39,7 @@ import com.threerings.presents.dobj.SubscriberAdapter;
import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.data.CrowdCodes;
import com.threerings.crowd.data.LocationCodes;
import com.threerings.crowd.data.LocationMarshaller;
import com.threerings.crowd.data.PlaceConfig;
import com.threerings.crowd.data.PlaceObject;
import com.threerings.crowd.util.CrowdContext;
@@ -66,8 +67,10 @@ public class LocationDirector extends BasicDirector
_cctx = ctx;
// register for location notifications
_cctx.getClient().getInvocationDirector().registerReceiver(
new LocationDecoder(this));
_cctx.getClient().getInvocationDirector().registerReceiver(new LocationDecoder(this));
// ensure that the compiler includes these necessary symbols
var i :int = LocationMarshaller.LEAVE_PLACE;
}
/**
@@ -32,6 +32,7 @@ import com.threerings.util.MethodQueue;
import com.threerings.presents.client.InvocationService_ConfirmListener;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.InvocationCodes;
import com.threerings.presents.data.TimeBaseMarshaller;
import com.threerings.presents.dobj.DObjectManager;
@@ -51,6 +52,9 @@ public class Client extends EventDispatcher
public function Client (creds :Credentials)
{
_creds = creds;
// ensure that the compiler includes these necessary symbols
var i :int = TimeBaseMarshaller.GET_TIME_OID;
}
/**