setRoomVariables. Server side. Lapo please help.

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

lordali
Posts: 41
Joined: 25 Mar 2008, 08:32

setRoomVariables. Server side. Lapo please help.

Postby lordali » 18 Sep 2009, 12:35

Hi,

Read the forum and tried everything. Find same problem and solutions here

http://www.smartfoxserver.com/forums/viewtopic.php?t=4838&highlight=setroomvariables

But its not working for me. Tried everything.
ERROR

Code: Select all

RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object it.gotoandplay.smartfoxserver.data.User@7b40aa23 of class it.gotoandplay.smartfoxserver.data.User where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.


My Code

Code: Select all

function handleRequest(cmd, params, user, fromRoom)
{
   if (cmd == "setVar")
      handleSetVar(user, fromRoom)
}

function handleSetVar(user, fromRoom)
{
   var theRoom = _server.getCurrentZone().getRoom(fromRoom)
   var rVars = []
     rVars.push( {name:"highscore", val:12000, priv:true} )


   _server.setRoomVariables(theRoom, user, rVars)
   //_server.setRoomVariables(theRoom, user, rVars, true, true);
}


The problem is with user object. if I put null than there is no exception.
Please help anyone.
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 19 Sep 2009, 12:30

Actually that's just a warning, not a real error. I have no idea why it is fired, however. The link you have mentioned was actually a different problem.
What server version is this?
Lapo
--
gotoAndPlay()
...addicted to flash games
lordali
Posts: 41
Joined: 25 Mar 2008, 08:32

Postby lordali » 19 Sep 2009, 14:19

Thanks for the reply.
I am using latest version 1.6.6.

It is triggered when I am using setRoomVariables and in it using user object. Otherwise no error of anything.
User avatar
marsoups
Posts: 167
Joined: 14 Apr 2008, 03:30

Postby marsoups » 21 Sep 2009, 08:54

See if you can trace out other properties of the user to see if there is something wrong with what's being passed in 'user' .. Never seen this error.
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 21 Sep 2009, 13:37

Another explanation is that you have changed the <ASCompilerOptimizationLevel> setting in the config.xml
Is this the case? If so try commenting the line with your custom setting and restart the server.
Lapo

--

gotoAndPlay()

...addicted to flash games
lordali
Posts: 41
Joined: 25 Mar 2008, 08:32

Postby lordali » 21 Sep 2009, 15:09

Thanks for the reply.
Haven't changed much in the config. Below is my config file. I will try to do some testing on it and see if I can get you the test example. Should I reinstall the server again which might fix the problem?

Code: Select all

<!--

   SmartFoxServer PRO
   (c) 2004-2009 gotoAndPlay()
   www.gotoandplay.it
   www.smartfoxserver.com
   
   Main Configuration file
   version 1.6.6
   
   NOTE:
   You can find detailed informations on how to configure the server by reading
   the tutorials in section 2 of the documentation.
   ( http://www.smartfoxserver.com/docs/docPages/config/basics.htm )
   
-->

<SmartFoxConfig>
   
   <ServerSetup>
      <!--
         Specify an ip address or use an asterisk(*) to bind all available IPs
      -->
      <ServerIP>*</ServerIP>
      <ServerPort>9339</ServerPort>
      
      <AutoSendPolicyFile>true</AutoSendPolicyFile>
      <MaxUserIdleTime>300</MaxUserIdleTime>
      <MaxSocketIdleTime>60</MaxSocketIdleTime>
      
      <!-- Server Variables limits (-1 = unlimited) -->
      <MaxRoomVars>-1</MaxRoomVars>
      <MaxUserVars>-1</MaxUserVars>
      
      <!-- New since 1.6.3, optimizes user variables size -->
      <UserVarsOptimization>true</UserVarsOptimization>
      
      <AntiFlood active="false">
         <MinMsgTime tolerance="5">1000</MinMsgTime>
         <MaxRepeatedMessages>3</MaxRepeatedMessages>
         <WarningsBeforeKick>2</WarningsBeforeKick>
         <WarningMessage><![CDATA[No flooding allowed!)]]></WarningMessage>
         <KickMessage><![CDATA[You've been warned! No flooding! Now you're kicked]]></KickMessage>
         <BanMessage><![CDATA[Stop Flooding!! You're being banned]]></BanMessage>         
         <BanAfter timeSpan="1">3</BanAfter>
      </AntiFlood>
      
      <BadWordsFilter active="false">
         <FilterMode>filter</FilterMode> <!-- REMOVE or FILTER -->
         <StripCharacters><![CDATA[,.;:_!$%&/#*-+]]></StripCharacters>
         <Warnings>true</Warnings>
         <FilterRoomNames>true</FilterRoomNames>
         <FilterUserNames>true</FilterUserNames>
         <WarningsBeforeKick>3</WarningsBeforeKick>
         <WarningMessage><![CDATA[No swearing!)]]></WarningMessage>
         <KickMessage><![CDATA[You've been warned! No Swearing! Now you're kicked]]></KickMessage>
         <BanMessage><![CDATA[Stop Swearing! You're being banned!]]></BanMessage>   
         <BanAfter timeSpan="1">3</BanAfter>
         
         <BadWordsList>            
            <badWord>dickhead</badWord>
            <badWord>asshole</badWord>
            <badWord>shithead</badWord>
            <badWord>shit</badWord>
            <badWord>fucking</badWord>
            <badWord>fuck</badWord>
            <badWord>dickhead</badWord>
            <badWord>bastard</badWord>
            <badWord>nigger</badWord>
            <badWord>idiot</badWord>
            <badWord>bitch</badWord>
         </BadWordsList>
      </BadWordsFilter>
      
      <BanCleaning>auto</BanCleaning>
      <BanDuration>1800</BanDuration> <!-- 30 min -->
      <BannedLoginMessage>You have been banned!</BannedLoginMessage>
      
      <OutQueueThreads>1</OutQueueThreads>
      <ExtHandlerThreads>1</ExtHandlerThreads>
      <MaxWriterQueue>50</MaxWriterQueue>
      
      <!--
         New since 1.6.0
         Set the client queue size and the max. allowed dropped packets
      -->
      <ClientMessagQueue>
         <QueueSize>100</QueueSize>
         <MaxAllowedDroppedPackets>10</MaxAllowedDroppedPackets>
      </ClientMessagQueue>
      
      <MaxIncomingQueue>5000</MaxIncomingQueue>
      <DeadChannelsPolicy>strict</DeadChannelsPolicy>
      <MaxMsgLen>4096</MaxMsgLen>
      
      <LogMaxSize>5000000</LogMaxSize>
      <LogMaxFiles>5</LogMaxFiles>
      
      <!--
         Available options are:
         
         FINEST
         FINER
         FINE
         CONFIG
         INFO
         WARNING
         SEVERE

      -->
      <FileLoggingLevel>INFO</FileLoggingLevel>
      <ConsoleLoggingLevel>INFO</ConsoleLoggingLevel>   
      
      <!-- Adminisitrator login -->
      <AdminLogin>sfs_admin</AdminLogin>
      <AdminPassword>sfs_pass</AdminPassword>
      
      <!-- Allowed administrator IP addresses -->
      <AdminAllowedAddresses>
         <AllowedAddress>*.*.*.*</AllowedAddress>
      </AdminAllowedAddresses>
      
      <!-- Allow remote debugging of extensions -->
      <ExtensionRemoteDebug>true</ExtensionRemoteDebug>
      
      <!--
         Allow global autoreload of extensions upon file save
         You should specify in each Zone if the autoreload is enabled.
      -->
      <AutoReloadExtensions>true</AutoReloadExtensions>
      
      <ExtensionRemoteDebug>true</ExtensionRemoteDebug>
      
      <IpFilter>0</IpFilter>
      
      <Mailer>
         <MailHost>test.mail.com</MailHost>
         <MailUser>foo</MailUser>
         <MailPass>bar</MailPass>
         <SmtpPort>25</SmtpPort>
         <WorkerThreads>1</WorkerThreads>
      </Mailer>
      
      <!-- Enable / Disable remote zone info -->
      <EnableZoneInfo>false</EnableZoneInfo>
      
      <!-- Enable / Disable embedded webserver -->
      <WebServer active="true">
         <CfgFile>webserver/cfg/jetty.xml</CfgFile>
      </WebServer>
      
      <!--  raw custom protocol separator -->
      <RawProtocolSeparator><![CDATA[%]]></RawProtocolSeparator>
      
      <!-- Enable NPCs -->
      <EnableNPC>true</EnableNPC>
      
      <!-- Use concurrent map for properties objects -->
      <DynamicPropertiesClass>java.util.concurrent.ConcurrentHashMap</DynamicPropertiesClass>
      
      <!-- Send a message to client, on wrong Zone. DISABLE THIS ONE IN PRODUCTION
      <WarnOnWrongZoneRequest><![CDATA[Invalid zone: %s]]></WarnOnWrongZoneRequest>
      -->
   </ServerSetup>
   
   
   
   <!--
      Zones Configuration.
   -->
   <Zones>   

      <!--
         Just removed zones
      -->


   </Zones>
   
   
</SmartFoxConfig>

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 39 guests