Page 1 of 1

Joining the wrong zone

Posted: 17 Oct 2008, 13:47
by potmo
Hi!

I have two zones called "couronnegold" and "px" in my config.xml

Code: Select all

<Zones>   
      <Zone name="couronnegold" uCountUpdate="false" emptyNames="false" customLogin="true">
         <Rooms></Rooms>
         <Extensions>
            <extension name="A" className="se.raketspel.smartbox.core.ExtensionCore" type="java"/>
         </Extensions>
      </Zone>
      <Zone name="px" uCountUpdate="false" emptyNames="false" customLogin="true">
         <Rooms></Rooms>
         <Extensions>
            <extension name="pxsomething" className="se.raketspel.smartbox.core.ExtensionCore" type="java"/>
         </Extensions>
      </Zone>
   </Zones>


The problem is that when I join the zone called "couronnegold" I end up in the zone called "px".

This is the xml-data sent from the client to join the zone
<msg t='sys'><body action='login' r='0'><login z='couronnegold'><nick><![CDATA[Frank]]></nick><pword><![CDATA[]]></pword></login></body></msg>


In my zone extension code I have a code snippet printing out the joined zone:

Code: Select all

   public void handleInternalEvent(InternalEventObject event) {
      String eventName = event.getEventName();
      try {
         if (eventName.equals("loginRequest")) {
            System.out.println("Trying to join zone: " + zoneName);
...
...


this prints out
Trying to join zone: px


What is the problem here? I suspect that it is that both zone-extensions are using the same class. But I must be able to do this right?

Serverversion: 1.6.1

Thanks in advance.

Posted: 19 Oct 2008, 18:06
by Lapo
In your code where does zoneName comes frome? How and when is it created?
Additionally when yoy handle the "loginRequest" event you get the name of the zone requested.

Code: Select all

String zoneName = event.getParam("zone")

Posted: 20 Oct 2008, 07:04
by potmo
I found it I think.

the variable "zone" was declared as
private static Zone zone;

Stupid. Its the littlest errata that makes the biggest headache.

Thanks!