[CODES] - SnowStorm - [JAVA]

Results 1 to 13 of 13
  1. #1
    Newbie Razsum is offline
    MemberRank
    Jul 2013 Join Date
    3Posts

    big grin [CODES] - SnowStorm - [JAVA]

    Hi friends, I take the trouble to do a couple of things in the SnowStorm & in a hotel that I only want to benefit themselves, I leave some code (in Java) so that ye may be able to create libraries & imports may know I leave the code & the name of the documents that must of put, thanks to Itachi & some codes, all credits to him.CurrentTimesToPlay
    Spoiler:
    public class CurrentTimesToPlay extends Handler implements Runnable { private ServerHandler Client; private Environment Server; private FutureTask T; public void Load(ServerHandler Client, Environment Server, FutureTask T) throws Exception { this.Client = Client; this.Server = Server; this.T = T; } public void run() { try { ServerMessage Plays = new ServerMessage(ServerEvents.CurrentSnowStormPlays); Plays.writeInt(-1); // full play, anyway, 3 = 3 plays an more idiot things Plays.Send(Client.Socket); } catch (Exception e) { } }}
    FriendLeaderBoard
    Spoiler:
    public class FriendLeaderBoard extends Handler implements Runnable { private ServerHandler Client; private Environment Server; private FutureTask T; public void Load(ServerHandler Client, Environment Server, FutureTask T) throws Exception { this.Client = Client; this.Server = Server; this.T = T; } public void run() { try { Habbo User = Client.GetSession(); ServerMessage Board = new ServerMessage(ServerEvents.FriendsLeaderBoard); Board.writeInt(1); // count Board.writeInt(User.Id); Board.writeInt(85000); Board.writeInt(1); // position? Board.writeUTF(User.UserName); Board.writeUTF(User.Look); Board.writeUTF(User.Gender.toLowerCase()); Board.writeInt(1); // repeat position (if it's me) Board.Send(Client.Socket); } catch (Exception e) { } }}[/code]
    GeneralLeaderBoard
    Spoiler:
    [code=java]public class GeneralLeaderBoard extends Handler implements Runnable { private ServerHandler Client; private Environment Server; private FutureTask T; public void Load(ServerHandler Client, Environment Server, FutureTask T) throws Exception { this.Client = Client; this.Server = Server; this.T = T; } public void run() { try { Habbo User = Client.GetSession(); ServerMessage Board = new ServerMessage(ServerEvents.GeneralLeaderBoard); Board.writeInt(2); // count Board.writeInt(User.Id); Board.writeInt(85000); Board.writeInt(1); // position? Board.writeUTF(User.UserName); Board.writeUTF(User.Look); Board.writeUTF(User.Gender.toLowerCase()); // my data Board.writeInt(User.Id); Board.writeInt(85000); Board.writeInt(1); // position? Board.writeUTF(User.UserName); Board.writeUTF(User.Look); Board.writeUTF(User.Gender.toLowerCase()); Board.writeInt(1); // repeat position (if i'm not in the count?) Board.Send(Client.Socket); } catch (Exception e) { } }}[/code]
    InitSnowStorm
    Spoiler:
    [code=java]public class InitSnowStorm extends Handler implements Runnable { private ServerHandler Client; private Environment Server; private FutureTask T; public void Load(ServerHandler Client, Environment Server, FutureTask T) throws Exception { this.Client = Client; this.Server = Server; this.T = T; } public void run() { try { Habbo User = Client.GetSession(); SnowWar.SearchASnowWarForMe(User); SnowWar CurrentWar = User.CurrentWar; ServerMessage Waiting = new ServerMessage(ServerEvents.WaitingForUsers); Waiting.writeInt(CurrentWar.Id); // Waiting.writeUTF("SnowStorm level " + CurrentWar.ArenaId); Waiting.writeInt(0); Waiting.writeInt(CurrentWar.ArenaId); // level Waiting.writeInt(CurrentWar.TeamCount); Waiting.writeInt(CurrentWar.MaxPlayers); Waiting.writeUTF(CurrentWar.Owner); // user name of room creator? Waiting.writeInt(14); Waiting.writeInt(CurrentWar.Players.size()); Iterator reader = CurrentWar.Players.iterator(); while(reader.hasNext()) { Habbo cUser = (Habbo)reader.next(); Waiting.writeInt(cUser.Id); Waiting.writeUTF(cUser.UserName); Waiting.writeUTF(cUser.Look); Waiting.writeUTF(cUser.Gender.toLowerCase()); Waiting.writeInt(-1); Waiting.writeInt(0); // stars Waiting.writeInt(0); // points Waiting.writeInt(10); // points for next level } Waiting.Send(Client.Socket); /*ServerMessage AddUser = new ServerMessage(ServerEvents.AddUsersToGame); AddUser.writeInt(654); AddUser.writeUTF("Itachi2"); AddUser.writeUTF(User.Look); AddUser.writeUTF(User.Gender.toLowerCase()); AddUser.writeInt(-1); AddUser.writeInt(0); // stars AddUser.writeInt(0); // points AddUser.writeInt(10); // points for next level AddUser.writeBoolean(false);*/ //AddUser.Send(Client.Socket); Thread.sleep(10000); // 2807 ServerMessage Waiting2 = new ServerMessage(2807); Waiting2.writeInt(CurrentWar.Id); // Waiting2.writeUTF("SnowStorm level " + CurrentWar.ArenaId); Waiting2.writeInt(0); Waiting2.writeInt(CurrentWar.ArenaId); // level Waiting2.writeInt(CurrentWar.TeamCount); Waiting2.writeInt(CurrentWar.MaxPlayers); Waiting2.writeUTF(CurrentWar.Owner); // user name of room creator? Waiting2.writeInt(14); Waiting2.writeInt(CurrentWar.Players.size()); Iterator reader2 = CurrentWar.BlueTeam.iterator(); while(reader2.hasNext()) { Habbo cUser = (Habbo)reader2.next(); Waiting2.writeInt(cUser.Id); Waiting2.writeUTF(cUser.UserName); Waiting2.writeUTF(cUser.Look); Waiting2.writeUTF(cUser.Gender.toLowerCase()); Waiting2.writeInt(1); // team Waiting2.writeInt(0); // stars Waiting2.writeInt(0); // points Waiting2.writeInt(10); // points for next level } Iterator reader3 = CurrentWar.RedTeam.iterator(); while(reader3.hasNext()) { Habbo cUser = (Habbo)reader3.next(); Waiting2.writeInt(cUser.Id); Waiting2.writeUTF(cUser.UserName); Waiting2.writeUTF(cUser.Look); Waiting2.writeUTF(cUser.Gender.toLowerCase()); Waiting2.writeInt(2); // team Waiting2.writeInt(10); // stars Waiting2.writeInt(20000000); // points Waiting2.writeInt(20000000); // points for next level } Waiting2.Send(Client.Socket); //Thread.sleep(7000); // StartGame! ServerMessage StartGame = new ServerMessage(ServerEvents.StartSnowGame); StartGame.writeInt(0); StartGame.writeInt(CurrentWar.ArenaId); StartGame.writeInt(CurrentWar.TeamCount); StartGame.writeInt(CurrentWar.Players.size()); Iterator treader = CurrentWar.Players.iterator(); while(treader.hasNext()) { Habbo cUser = (Habbo)treader.next(); StartGame.writeInt(cUser.Id); StartGame.writeUTF(cUser.UserName); StartGame.writeUTF(cUser.Look); StartGame.writeUTF(cUser.Gender.toLowerCase()); StartGame.writeInt(2); // team? } StartGame.writeInt(2); StartGame.writeInt(2); StartGame.writeUTF(RoomModel.Models.get("snowstorm_model" + CurrentWar.ArenaId).SerializeMap); StartGame.writeInt(0); /*StartGame.writeUTF("ads_background"); StartGame.writeInt(0); StartGame.writeInt(0); StartGame.writeInt(0); StartGame.writeInt(1); StartGame.writeInt(1); StartGame.writeInt(0); StartGame.writeInt(1); StartGame.writeBoolean(false); StartGame.writeInt(1); StartGame.writeInt(1); StartGame.writeInt(5); StartGame.writeUTF("state"); StartGame.writeUTF("0"); StartGame.writeUTF("offsetZ"); StartGame.writeUTF("10000"); StartGame.writeUTF("offsetY"); StartGame.writeUTF("1542"); StartGame.writeUTF("imageUrl"); StartGame.writeUTF("http://images.habbo.com/c_images/DEV_tests/snst_bg_1_a_big.png"); StartGame.writeUTF("offsetX"); StartGame.writeUTF("-1166");*/ StartGame.Send(Client.Socket); ServerMessage UserInfo = new ServerMessage(3180); UserInfo.writeInt(User.Id); UserInfo.writeUTF(User.UserName); UserInfo.writeUTF(User.Look); UserInfo.writeUTF(User.Gender.toLowerCase()); UserInfo.writeInt(2); UserInfo.Send(Client.Socket); // User ready! ServerMessage More = new ServerMessage(3630); More.writeInt(0); More.Send(Client.Socket); Thread.sleep(15000); ServerMessage Arena = new ServerMessage(2873); Arena.writeInt(0); Arena.writeUTF("snowwar_arena_0"); /*Arena.writeInt(5); Arena.writeInt(27); Arena.writeInt(2); Arena.writeInt(0); Arena.writeInt(41535); Arena.writeInt(47935); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(0); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(1); Arena.writeInt(2); Arena.writeInt(1); Arena.writeInt(96000); Arena.writeInt(22335); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(6); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(47935); Arena.writeInt(32000); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(7); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(3); Arena.writeInt(15935); Arena.writeInt(76800); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(8); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(4); Arena.writeInt(83200); Arena.writeInt(762800); Arena.writeInt(0); Arena.writeInt(5); Arena.writeInt(0); Arena.writeInt(10); Arena.writeInt(2); Arena.writeInt(5); Arena.writeInt(150335); Arena.writeInt(102400); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(16); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(6); Arena.writeInt(83200); Arena.writeInt(19200); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(16); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(6); Arena.writeInt(83200); Arena.writeInt(19200); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(20); Arena.writeInt(3); Arena.writeInt(7); Arena.writeInt(7); Arena.writeInt(28735); Arena.writeInt(81727); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(37); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(8); Arena.writeInt(19200); Arena.writeInt(64000); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(450); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(9); Arena.writeInt(156735); Arena.writeInt(89600); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(41); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(10); Arena.writeInt(79935); Arena.writeInt(121600); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(52); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(1); Arena.writeInt(64000); Arena.writeInt(12800); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(53); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(12); Arena.writeInt(115200); Arena.writeInt(47935); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(55); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(13); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(56); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(14); Arena.writeInt(143935); Arena.writeInt(79935); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(59); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(15); Arena.writeInt(47935); Arena.writeInt(108800); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(65); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(16); Arena.writeInt(32000); Arena.writeInt(83200); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(82); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(17); Arena.writeInt(64000); Arena.writeInt(25600); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(92); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(2); Arena.writeInt(18); Arena.writeInt(86900); Arena.writeInt(150335); Arena.writeInt(0); Arena.writeInt(4800); Arena.writeInt(0); Arena.writeInt(3); Arena.writeInt(0); Arena.writeInt(5);*/ // user serialize? wtf? Arena.writeInt(0); Arena.writeInt(0); Arena.writeInt(0); Arena.writeInt(0); Arena.writeInt(0); /* Arena.writeInt(5); Arena.writeInt(21); Arena.writeInt(60735); Arena.writeInt(15935); Arena.writeInt(19); Arena.writeInt(5); Arena.writeInt(4); Arena.writeInt(5); Arena.writeInt(0); Arena.writeInt(0); Arena.writeInt(0); Arena.writeInt(19); Arena.writeInt(5); Arena.writeInt(60735); Arena.writeInt(15935); Arena.writeInt(0); Arena.writeInt(2); //[1]¾?¨[0][10]julian6820[0][5]LOL!![0]+hr-893-31.hd-3095-8.ch-3111-82-62.lg-270-91[0][1]m[0][0][0][5][0][0][0][0][0]í?[0][0]>?[0][0][0][0][0][0][5][0][0][0][4][0][0][0][5][0][0][0][5][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][5][0][0]í?[0][0]>?[0][0][0][0][0][0][0] Arena.writeInt(User.Id); Arena.writeUTF(User.UserName); Arena.writeUTF(User.Motto); Arena.writeUTF(User.Look); Arena.writeUTF(User.Gender.toLowerCase());*/ Arena.Send(Client.Socket); //[INT] > [0]: [0][0][0][0] } catch (Exception e) { Server.WriteLine(e); } }}[/code]
    TalkOnSnow
    Spoiler:
    [code=java]public class TalkOnSnow extends Handler implements Runnable { private ServerHandler Client; private Environment Server; private FutureTask T; Override public void Load(ServerHandler Client, Environment Server, FutureTask T) throws Exception { this.Client = Client; this.Server = Server; this.T = T; } public void run() { try { Habbo CurrentUser = Client.GetSession(); int RoomId = CurrentUser.CurrentRoomId; Channel Socket = Client.Socket; Room R = Room.Rooms.get(RoomId); String Message = Client.in.readUTF(); ServerMessage Talk = new ServerMessage(ServerEvents.TalkOnSnow); Talk.writeInt(CurrentUser.Id); Talk.writeUTF(Message); Talk.writeInt(0); Talk.Send(Socket); } catch (Exception e) { } } }[/code]
    Has no checksum system or the pathfinding, because without the checksum that is imaginary, you must have, in my case I have it, but if you upload everything wouldn't be (oriented to developers), if I find many people asking me the pathfinding Greetings


  2. #2
    Grand Master Emily is offline
    Grand MasterRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,408Posts

    Re: [CODES] - SnowStorm - [JAVA]

    Use code tags, best thing is use the PHP tag (PHP between [ and ]) because it colors the codes, making it easier to read them. Putting them just in a spoiler is bad thing..

    Anyways, it looks static in my eyes, I think it can be improved lots. There's no emulator I think on which you can use it because no Java emulator has started the gamecenter.

  3. #3
    Newbie Razsum is offline
    MemberRank
    Jul 2013 Join Date
    3Posts

    Re: [CODES] - SnowStorm - [JAVA]

    Quote Originally Posted by Tha View Post
    Use code tags, best thing is use the PHP tag (PHP between [ and ]) because it colors the codes, making it easier to read them. Putting them just in a spoiler is bad thing..

    Anyways, it looks static in my eyes, I think it can be improved lots. There's no emulator I think on which you can use it because no Java emulator has started the gamecenter.
    They can do what they want, good in Java is easier to encode, good about what label to PHP, I am new and do not know how this works very well, which come from other Spanish, (I am Spanish)

  4. #4
    Grand Master Emily is offline
    Grand MasterRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,408Posts

    Re: [CODES] - SnowStorm - [JAVA]

    Quote Originally Posted by Razsum View Post
    They can do what they want, good in Java is easier to encode, good about what label to PHP, I am new and do not know how this works very well, which come from other Spanish, (I am Spanish)
    You use:

    [code=java]

    But there's no such thing as [code=java], change it to PHP between [ and ] and [/code] to [/PHP]

  5. #5
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,486Posts

    Re: [CODES] - SnowStorm - [JAVA]

    Thanks for not indenting the code.

  6. #6
    Newbie Razsum is offline
    MemberRank
    Jul 2013 Join Date
    3Posts

    Re: [CODES] - SnowStorm - [JAVA]

    I do not understand...

  7. #7
    Grand Master Chapo is offline
    Grand MasterRank
    Jul 2010 Join Date
    United StatesLocation
    944Posts

    Re: [CODES] - SnowStorm - [JAVA]

    Credits? :<
    Nice Copy + Paste btw :<

  8. #8
    Grand Master Emily is offline
    Grand MasterRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,408Posts

    Re: [CODES] - SnowStorm - [JAVA]

    Quote Originally Posted by Ryan View Post
    Credits? :<
    Nice Copy + Paste btw :<
    thanks to Itachi & some codes, all credits to him.

    This answered your question?

  9. #9
    Ask me about Daoism FullmetalPride is offline
    Grand MasterRank
    Nov 2010 Join Date
    2,172Posts

    Re: [CODES] - SnowStorm - [JAVA]

    Regardless of the copy and pasting, poor kid doesn't know English obviously.


    Esta versión no tiene el formato correcto. Necesitas guión el código informático y debe envolver en etiquetas PHP, en lugar de etiquetas de código. Además, usted debe dar crédito a Itachi para el código ya que era la suya.

    Usted no puede utilizar este código, ya que no tiene emulador de Java Gamecenter.


    Spanish class sucks so there's always Google Translate. ;)

  10. #10
    I don't even know azaidi is offline
    Grand MasterRank
    Apr 2010 Join Date
    the NetherlandsLocation
    2,065Posts

    Re: [CODES] - SnowStorm - [JAVA]

    PHP Code:
    public class CurrentTimesToPlay extends Handler implements Runnable
    {
        private 
    ServerHandler Client;
        private 
    Environment Server;
        private 
    FutureTask T;

        public 
    void Load(ServerHandler ClientEnvironment ServerFutureTask Tthrows Exception
        
    {
            
    this.Client Client;
            
    this.Server Server;
            
    this.T;
        }

        public 
    void run()
        {
            try
            {
                
    ServerMessage Plays = new ServerMessage(ServerEvents.CurrentSnowStormPlays);
                
    Plays.writeInt(-1); // full play, anyway, 3 = 3 plays an more idiot things
                
    Plays.Send(Client.Socket);
            }
            catch (
    Exception e)
            {
            }
        }
    }

    public class 
    FriendLeaderBoard extends Handler implements Runnable
    {
        private 
    ServerHandler Client;
        private 
    Environment Server;
        private 
    FutureTask T;

        public 
    void Load(ServerHandler ClientEnvironment ServerFutureTask Tthrows Exception
        
    {
            
    this.Client Client;
            
    this.Server Server;
            
    this.T;
        }

        public 
    void run()
        {
            try
            {
                
    Habbo User Client.GetSession();
                
    ServerMessage Board = new ServerMessage(ServerEvents.FriendsLeaderBoard);
                
    Board.writeInt(1); // count
                
    Board.writeInt(User.Id);
                
    Board.writeInt(85000);
                
    Board.writeInt(1); // position?
                
    Board.writeUTF(User.UserName);
                
    Board.writeUTF(User.Look);
                
    Board.writeUTF(User.Gender.toLowerCase());
                
    Board.writeInt(1); // repeat position (if it's me)
                
    Board.Send(Client.Socket);
            }
            catch (
    Exception e)
            {
            }
        }
    }

    public class 
    GeneralLeaderBoard extends Handler implements Runnable
    {
        private 
    ServerHandler Client;
        private 
    Environment Server;
        private 
    FutureTask T;
        public 
    void Load(ServerHandler ClientEnvironment ServerFutureTask Tthrows Exception
        
    {
            
    this.Client Client;
            
    this.Server Server;
            
    this.T;
        }

        public 
    void run()
        {
            try
            {
                
    Habbo User Client.GetSession();
                
    ServerMessage Board = new ServerMessage(ServerEvents.GeneralLeaderBoard);
                
    Board.writeInt(2); // count
                
    Board.writeInt(User.Id);
                
    Board.writeInt(85000);
                
    Board.writeInt(1); // position?
                
    Board.writeUTF(User.UserName);
                
    Board.writeUTF(User.Look);
                
    Board.writeUTF(User.Gender.toLowerCase()); // my data
                
    Board.writeInt(User.Id);
                
    Board.writeInt(85000);
                
    Board.writeInt(1); // position?
                
    Board.writeUTF(User.UserName);
                
    Board.writeUTF(User.Look);
                
    Board.writeUTF(User.Gender.toLowerCase());
                
    Board.writeInt(1); // repeat position (if i'm not in the count?)
                
    Board.Send(Client.Socket);
            }
            catch (
    Exception e)
            {
            }
        }
    }

    public class 
    TalkOnSnow extends Handler implements Runnable
    {
        private 
    ServerHandler Client;
        private 
    Environment Server;
        private 
    FutureTask T;

        
    Override public void Load(ServerHandler ClientEnvironment ServerFutureTask Tthrows Exception
        
    {
            
    this.Client Client;
            
    this.Server Server;
            
    this.T;
        }

        public 
    void run()
        {
            try
            {
                
    Habbo CurrentUser Client.GetSession();
                
    int RoomId CurrentUser.CurrentRoomId;
                
    Channel Socket Client.Socket;
                
    Room R Room.Rooms.get(RoomId);
                
    String Message Client.in.readUTF();
                
    ServerMessage Talk = new ServerMessage(ServerEvents.TalkOnSnow);
                
    Talk.writeInt(CurrentUser.Id);
                
    Talk.writeUTF(Message);
                
    Talk.writeInt(0);
                
    Talk.Send(Socket);
            }
            catch (
    Exception e)
            {
            }
        }

    I'm too bored..

    __

    Can anyone explain to me why there is throws Exception after the function name? I'm used to C# so I don't understand what it means in Java

  11. #11
    Grand Master Emily is offline
    Grand MasterRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,408Posts

    Re: [CODES] - SnowStorm - [JAVA]

    Quote Originally Posted by azaidi View Post
    PHP Code:
    public class CurrentTimesToPlay extends Handler implements Runnable
    {
        private 
    ServerHandler Client;
        private 
    Environment Server;
        private 
    FutureTask T;

        public 
    void Load(ServerHandler ClientEnvironment ServerFutureTask Tthrows Exception
        
    {
            
    this.Client Client;
            
    this.Server Server;
            
    this.T;
        }

        public 
    void run()
        {
            try
            {
                
    ServerMessage Plays = new ServerMessage(ServerEvents.CurrentSnowStormPlays);
                
    Plays.writeInt(-1); // full play, anyway, 3 = 3 plays an more idiot things
                
    Plays.Send(Client.Socket);
            }
            catch (
    Exception e)
            {
            }
        }
    }

    public class 
    FriendLeaderBoard extends Handler implements Runnable
    {
        private 
    ServerHandler Client;
        private 
    Environment Server;
        private 
    FutureTask T;

        public 
    void Load(ServerHandler ClientEnvironment ServerFutureTask Tthrows Exception
        
    {
            
    this.Client Client;
            
    this.Server Server;
            
    this.T;
        }

        public 
    void run()
        {
            try
            {
                
    Habbo User Client.GetSession();
                
    ServerMessage Board = new ServerMessage(ServerEvents.FriendsLeaderBoard);
                
    Board.writeInt(1); // count
                
    Board.writeInt(User.Id);
                
    Board.writeInt(85000);
                
    Board.writeInt(1); // position?
                
    Board.writeUTF(User.UserName);
                
    Board.writeUTF(User.Look);
                
    Board.writeUTF(User.Gender.toLowerCase());
                
    Board.writeInt(1); // repeat position (if it's me)
                
    Board.Send(Client.Socket);
            }
            catch (
    Exception e)
            {
            }
        }
    }

    public class 
    GeneralLeaderBoard extends Handler implements Runnable
    {
        private 
    ServerHandler Client;
        private 
    Environment Server;
        private 
    FutureTask T;
        public 
    void Load(ServerHandler ClientEnvironment ServerFutureTask Tthrows Exception
        
    {
            
    this.Client Client;
            
    this.Server Server;
            
    this.T;
        }

        public 
    void run()
        {
            try
            {
                
    Habbo User Client.GetSession();
                
    ServerMessage Board = new ServerMessage(ServerEvents.GeneralLeaderBoard);
                
    Board.writeInt(2); // count
                
    Board.writeInt(User.Id);
                
    Board.writeInt(85000);
                
    Board.writeInt(1); // position?
                
    Board.writeUTF(User.UserName);
                
    Board.writeUTF(User.Look);
                
    Board.writeUTF(User.Gender.toLowerCase()); // my data
                
    Board.writeInt(User.Id);
                
    Board.writeInt(85000);
                
    Board.writeInt(1); // position?
                
    Board.writeUTF(User.UserName);
                
    Board.writeUTF(User.Look);
                
    Board.writeUTF(User.Gender.toLowerCase());
                
    Board.writeInt(1); // repeat position (if i'm not in the count?)
                
    Board.Send(Client.Socket);
            }
            catch (
    Exception e)
            {
            }
        }
    }

    public class 
    TalkOnSnow extends Handler implements Runnable
    {
        private 
    ServerHandler Client;
        private 
    Environment Server;
        private 
    FutureTask T;

        
    Override public void Load(ServerHandler ClientEnvironment ServerFutureTask Tthrows Exception
        
    {
            
    this.Client Client;
            
    this.Server Server;
            
    this.T;
        }

        public 
    void run()
        {
            try
            {
                
    Habbo CurrentUser Client.GetSession();
                
    int RoomId CurrentUser.CurrentRoomId;
                
    Channel Socket Client.Socket;
                
    Room R Room.Rooms.get(RoomId);
                
    String Message Client.in.readUTF();
                
    ServerMessage Talk = new ServerMessage(ServerEvents.TalkOnSnow);
                
    Talk.writeInt(CurrentUser.Id);
                
    Talk.writeUTF(Message);
                
    Talk.writeInt(0);
                
    Talk.Send(Socket);
            }
            catch (
    Exception e)
            {
            }
        }

    I'm too bored..

    __

    Can anyone explain to me why there is throws Exception after the function name? I'm used to C# so I don't understand what it means in Java
    Let me give an example:

    PHP Code:
    void Lol()
    {
    try
    {
    Integer.parseInt("hello");
    }
    catch (
    Exception ex)
    {
    ex.printStackTrace();
    }

    Is almost the same as:

    PHP Code:
    void Lol() throws Exception
    {
    Integer.parseInt("hello");

    However, if you use throws exception except of try-catch, you need to throw that exception everytime you run that method (can also be done with try-catch). If you used my method #1, you can run that method in main void without throwing exception/new try-catch. If you use my method #2, your main void needs to contain try-catch (with the method Lol in try) or throws Exception

  12. #12
    Sorcerer Supreme lRetros is offline
    Member +Rank
    Mar 2011 Join Date
    Madrid, SpainLocation
    289Posts

    Re: [CODES] - SnowStorm - [JAVA]

    He's just a noob who copied things from the Itachi servers and re-released them without know his functions, is something i can't understand, how someone release this type of things without know the use and how can help other people.. but it was worse in Kekomundo, he released the same and he tried to cheat the noobs of the community looking like a proffesional.. LOL

  13. #13
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,486Posts

    Re: [CODES] - SnowStorm - [JAVA]

    The code implements Runnable suggesting a thread is created each time it's handled the packet?



Advertisement