Thread: [PI] Orphaned case

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 [PI] Orphaned case 
    Before "You" I Serve Nothing Mark's Avatar
    Join Date
    Sep 2010
    Posts
    1,018
    Thanks given
    36
    Thanks received
    87
    Rep Power
    21
    src\server\model\players\packets\BankX1.java:25: orphaned case
    case 608:
    ^
    1 error
    Press any key to continue . . .
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Feb 2008
    Posts
    384
    Thanks given
    30
    Thanks received
    26
    Rep Power
    0
    you have an extra bracket somewhere most likely.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Oct 2010
    Posts
    168
    Thanks given
    4
    Thanks received
    4
    Rep Power
    1
    Orphaned cases are cases which lie outside of a switch statement.

    Such as:
    Code:
    switch(proper) {
     case 0:
      //data
      break;
     case 1:
      //data.
      break;
    }
    Code:
    switch(inproper) {
     case 0:
      //data
      break;
    }
     case 1:
      //data.
      break;
    In the inproper switch statement, case 1 would be printed as an orphaned case, whilst compiling.
    Reply With Quote  
     

  4. #4  
    Before "You" I Serve Nothing Mark's Avatar
    Join Date
    Sep 2010
    Posts
    1,018
    Thanks given
    36
    Thanks received
    87
    Rep Power
    21
    Quote Originally Posted by EmulousGuru View Post
    Orphaned cases are cases which lie outside of a switch statement.

    Such as:
    Code:
    switch(proper) {
     case 0:
      //data
      break;
     case 1:
      //data.
      break;
    }
    Code:
    switch(inproper) {
     case 0:
      //data
      break;
    }
     case 1:
      //data.
      break;
    In the inproper switch statement, case 1 would be printed as an orphaned case, whilst compiling.
    I got a error from BANKX1.java

    i added this there
    case 608:
    if (c.myShopId == 39 && c.memberStatus < 2) {
    c.sendMessage("You must be a Super donator to buy from this shop.");
    return;
    }
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Oct 2010
    Posts
    168
    Thanks given
    4
    Thanks received
    4
    Rep Power
    1
    Post your whole BANKX1 class, please.
    Reply With Quote  
     

  6. #6  
    Before "You" I Serve Nothing Mark's Avatar
    Join Date
    Sep 2010
    Posts
    1,018
    Thanks given
    36
    Thanks received
    87
    Rep Power
    21
    Quote Originally Posted by EmulousGuru View Post
    Post your whole BANKX1 class, please.
    package server.model.players.packets;

    import server.model.players.Client;
    import server.model.players.PacketType;
    /**
    * Bank X Items
    **/
    public class BankX1 implements PacketType {

    public static final int PART1 = 135;
    public static final int PART2 = 208;
    public int XremoveSlot, XinterfaceID, XremoveID, Xamount;
    @Override
    public void processPacket(Client c, int packetType, int packetSize) {
    if (packetType == 135) {
    c.xRemoveSlot = c.getInStream().readSignedWordBigEndian();
    c.xInterfaceId = c.getInStream().readUnsignedWordA();
    c.xRemoveId = c.getInStream().readSignedWordBigEndian();
    }
    if (c.xInterfaceId == 3900) {
    if (c.myShopId == 30 && c.memberStatus < 1) {
    c.sendMessage("You must be a donator to buy from this shop.");
    return;
    }
    case 608:
    if (c.myShopId == 39 && c.memberStatus < 2) {
    c.sendMessage("You must be a Super donator to buy from this shop.");
    return;
    }
    case 619:
    if (c.myShopId == 40 && c.memberStatus < 2) {
    c.sendMessage("You must be a Super donator to buy from this shop.");
    return;
    }
    c.getShops().buyItem(c.xRemoveId, c.xRemoveSlot, 100);//buy 20
    c.xRemoveSlot = 0;
    c.xInterfaceId = 0;
    c.xRemoveId = 0;
    return;
    }

    if(packetType == PART1) {
    synchronized(c) {
    c.getOutStream().createFrame(27);
    }
    }

    }
    }
    ss
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Oct 2010
    Posts
    168
    Thanks given
    4
    Thanks received
    4
    Rep Power
    1
    Code:
    package server.model.players.packets;
    
    import server.model.players.Client;
    import server.model.players.PacketType;
    
    public class BankX1 implements PacketType {
    	public static final int PART1 = 135;
    	public static final int PART2 = 208;
    	public int XremoveSlot, XinterfaceID, XremoveID, Xamount;
    
    	@Override
    	public void processPacket(Client c, int packetType, int packetSize) {
    		if (packetType == 135) {
    			c.xRemoveSlot = c.getInStream().readSignedWordBigEndian();
    			c.xInterfaceId = c.getInStream().readUnsignedWordA();
    			c.xRemoveId = c.getInStream().readSignedWordBigEndian();
    		}
    		if (c.xInterfaceId == 3900) {
    			if (c.myShopId == 30 && c.memberStatus < 1) {
    				c.sendMessage("You must be a donator to buy from this shop.");
    				return;
    			}
    			if (c.myShopId == 39 && c.memberStatus < 2) {
    				c.sendMessage("You must be a Super donator to buy from this shop.");
    				return;
    			}
    			if (c.myShopId == 40 && c.memberStatus < 2) {
    				c.sendMessage("You must be a Super donator to buy from this shop.");
    				return;
    			}
    			c.getShops().buyItem(c.xRemoveId, c.xRemoveSlot, 100);//buy 20
    			c.xRemoveSlot = 0;
    			c.xInterfaceId = 0;
    			c.xRemoveId = 0;
    			return;
    		}
    		if(packetType == PART1) {
    			synchronized(c ) {
    				c.getOutStream().createFrame(27);
    			}
    		}
    	}
    }
    Remove the space in the red.
    Reply With Quote  
     

  8. #8  
    Registered Member
    Ninja assassin's Avatar
    Join Date
    Oct 2008
    Posts
    1,961
    Thanks given
    217
    Thanks received
    115
    Rep Power
    77
    lol nvmmm
    Btc: 1tpWTbAznzWYh6YpoUJeQ3MDVK56GGJ
    Reply With Quote  
     

  9. #9  
    Before "You" I Serve Nothing Mark's Avatar
    Join Date
    Sep 2010
    Posts
    1,018
    Thanks given
    36
    Thanks received
    87
    Rep Power
    21
    Quote Originally Posted by EmulousGuru View Post
    Code:
    package server.model.players.packets;
    
    import server.model.players.Client;
    import server.model.players.PacketType;
    
    public class BankX1 implements PacketType {
    	public static final int PART1 = 135;
    	public static final int PART2 = 208;
    	public int XremoveSlot, XinterfaceID, XremoveID, Xamount;
    
    	@Override
    	public void processPacket(Client c, int packetType, int packetSize) {
    		if (packetType == 135) {
    			c.xRemoveSlot = c.getInStream().readSignedWordBigEndian();
    			c.xInterfaceId = c.getInStream().readUnsignedWordA();
    			c.xRemoveId = c.getInStream().readSignedWordBigEndian();
    		}
    		if (c.xInterfaceId == 3900) {
    			if (c.myShopId == 30 && c.memberStatus < 1) {
    				c.sendMessage("You must be a donator to buy from this shop.");
    				return;
    			}
    			if (c.myShopId == 39 && c.memberStatus < 2) {
    				c.sendMessage("You must be a Super donator to buy from this shop.");
    				return;
    			}
    			if (c.myShopId == 40 && c.memberStatus < 2) {
    				c.sendMessage("You must be a Super donator to buy from this shop.");
    				return;
    			}
    			c.getShops().buyItem(c.xRemoveId, c.xRemoveSlot, 100);//buy 20
    			c.xRemoveSlot = 0;
    			c.xInterfaceId = 0;
    			c.xRemoveId = 0;
    			return;
    		}
    		if(packetType == PART1) {
    			synchronized(c ) {
    				c.getOutStream().createFrame(27);
    			}
    		}
    	}
    }
    Remove the space in the red.
    There was no space there and its still the error


    src\server\model\players\packets\BankX1.java:25: orphaned case
    case 608:
    ^
    1 error
    Press any key to continue . . .
    Reply With Quote  
     

  10. #10  
    Before "You" I Serve Nothing Mark's Avatar
    Join Date
    Sep 2010
    Posts
    1,018
    Thanks given
    36
    Thanks received
    87
    Rep Power
    21
    Fixed had to delete case 608 and case 619 lol..
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 5
    Last Post: 11-10-2010, 08:05 PM
  2. Orphaned Case (Rep++)
    By artemis in forum Help
    Replies: 7
    Last Post: 06-04-2010, 01:02 AM
  3. Orphaned Case 218
    By Rugrats in forum Help
    Replies: 13
    Last Post: 08-31-2009, 06:11 PM
  4. orphaned case 17
    By Shamcooly in forum Help
    Replies: 4
    Last Post: 04-18-2009, 02:46 PM
  5. Replies: 3
    Last Post: 02-16-2009, 06:25 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •