Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package hybrid.core.events.ss;
- import java.nio.ByteBuffer;
- import hybrid.core.*;
- import hybrid.core.tools.*;
- import hybrid.core.consts.*;
- /**
- * The PowerballGoal event is fired when a player scores a goal with a powerball.
- * <P>
- * <PRE>Packet Layout
- * Field Length Description
- * 0 1 Packet ID: 0x0B
- * 1 2 Team number (Frequency)
- * 3 4 Points Awarded
- * </PRE>
- *
- * @author Chris "Cerium" Rog
- */
- public class PowerballGoal extends SSPacket
- {
- private int intFreq;
- private long lngPoints;
- // Constructor
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- /**
- * Creates a new instance of the PowerballGoal event.
- *
- * @param objConnection The SSConnection object that generated this event.
- * @param objPacket The decrypted & unwrapped packet data. All core-packet headers must be
- * stripped.
- */
- public PowerballGoal(SSConnection objConnection, ByteBuffer objPacket)
- {
- super(SSEvents.PowerballGoal, objConnection, objPacket);
- if(objPacket.capacity() == 7)
- {
- this.intFreq = objPacket.getShort(1);
- this.lngPoints = objPacket.getInt(3);
- } else {
- System.out.println("Malformed 'SoccerGoal' Packet -- [Expected Size: 7] [Actual Size: " + objPacket.capacity() + "]");
- this.killEvent();
- }
- }
- // Public Functions
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- /**
- * Returns the team number (frequency) that scored the goal.
- *
- * @return See above.
- */
- public int getFreq() { return this.intFreq; }
- /**
- * Returns the amount of points awarded to each player on the team that scored the goal.
- *
- * @return See above.
- */
- public long getPoints() { return this.lngPoints; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement