Exception while adding NPC

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

Moderators: Lapo, Bax

User avatar
potmo
Posts: 154
Joined: 02 Feb 2007, 14:28
Location: Stockholm Sweden
Contact:

Exception while adding NPC

Postby potmo » 03 Dec 2008, 08:34

Hi When I try to add a NPC i get this error

java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Net.java:30)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:451)
at it.gotoandplay.smartfoxserver.extensions.ExtensionHelper.createNPC(ExtensionHelper.java:1246)
at se.raketspel.smartbox.core.ExtensionCore.createBot(ExtensionCore.java:498)
at se.raketspel.miniclipcouronne.application.singleplayerLobby.SingleplayerLobby.REQNEWGAME(SingleplayerLobby.java:88)
at se.raketspel.miniclipcouronne.application.singleplayerLobby.SingleplayerLobbyProtocolManager.decodeMessage(SingleplayerLobbyProtocolManager.java:107)
at se.raketspel.smartbox.core.ExtensionCore.handleRequest(ExtensionCore.java:299)
at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.processEvent(ExtensionHandler.java:539)
at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.run(ExtensionHandler.java:344)
at java.lang.Thread.run(Thread.java:613)


the code looks like this


Code: Select all

   public UserInterface createBot(String username){
      User sfUser = this.getHelper().createNPC(username, "127.0.0.1 ", 9339, this.getOwnerZone());
      
      return null;
   }


And my settings look like this:

--- [ Server Starting ] ---------------------------------

Server address: 80.76.150.36
Server port : 9339


And also this:

Code: Select all

--- [ System Info ] ------------------------------------------

System CPU(s): 2
VM Max memory: 66 MB

os.name: Mac OS X
os.arch: i386
os.version: 10.5.5
java.version: 1.5.0_16
java.vendor: Apple Inc.
java.vendor.url: http://www.apple.com/
java.vm.specification.version: 1.0
java.vm.version: 1.5.0_16-133
java.vm.vendor: Apple Inc.
java.vm.name: Java HotSpot(TM) Client VM


--- [ Network Cards ] -----------------------------------------

Card:en3
 -> 10.211.55.2
 -> fe80:0:0:0:21c:42ff:fe00:1%8
Card:en2
 -> 10.37.129.2
 -> fe80:0:0:0:21c:42ff:fe00:0%7
Card:en0
 -> 192.168.1.13
 -> fe80:0:0:0:21e:c2ff:fe06:dbde%4
Card:lo0
 -> 127.0.0.1
 -> 0:0:0:0:0:0:0:1
 -> fe80:0:0:0:0:0:0:1%1


--- [ Licence Loaded ] ------------------------------------

License type    -> PRO
License owner    -> --== Free Demo Licence ==--
Max clients    -> 20
Bluebox type    -> Demo Version

--- [ Zones & Rooms ] -------------------------------------


Am I supposed to use "80.76.150.36" as ip since the server is started on that address? If that is the case i would like to know if there is any way to dynamically get the server-ip since the ip will change when we are putting this on the production-servers instead of the development servers (this log is copied from the dev-servers).
Nisse Bergman
Raketspel
User avatar
potmo
Posts: 154
Joined: 02 Feb 2007, 14:28
Location: Stockholm Sweden
Contact:

Postby potmo » 03 Dec 2008, 08:44

Sorry pals. The hawkeyed saw that the ip in

Code: Select all

User sfUser = this.getHelper().createNPC(username, "127.0.0.1 ", 9339, this.getOwnerZone());

had a space after 127.0.0.1.
Removing that space made it work.
Nisse Bergman

Raketspel

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 24 guests