Thread: Florence Framework

Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1 Florence Framework 
    Registered Member
    Join Date
    Apr 2016
    Posts
    19
    Thanks given
    3
    Thanks received
    12
    Rep Power
    69
    Florence



    Some of you may remember me, I used to post here infrequently several years ago. Back then I was relatively new to Java but still drafted several (poor) frameworks for the 317 revision. I didn't have a great understanding of synchronization and it really showed when re-reading my old code. I'd like to think i've come a long way since then. I recently began developing a base for a small server I intend to work on and wanted to make it available for anyone else interested. This server is by no means bare like most frameworks that get posted. This server has been in development for roughly two months.

    Github : [Only registered and activated users can see links. ]



    Gameplay Features:
    • Login
    • Rendering
    • Inventory & Equipment Support
    • Very Basic Combat & Pathfinding
    • Walking
    • Running
    • Teleporting
    • NPC Rendering
    • Animation & Action Buttons
    • Talking
    • Logging In & Out
    • NPC Interactions
    • Skill Levels


    The server runs on a powerful NIO implementation and was able to connect and disconnect 1000 connections without missing a single one. I haven't been able to stress test the server with higher numbers as my only available computer at the moment is an old macbook air. In theory, it should be able to hold 2000 connections relatively easily on an actual desktop. The server is well documented and is very easy to understand. The networking infrastructure is similar to netty, but stripped down to the bare essentials that would be required for this type of application.

    The network is relatively abstract and flexible in it's own context. I'll provide a small example from the construction of outgoing packets.

    Code:
    /*
     * Copyright (C) 2019 Dylan Vicchiarelli
     *
     * This program is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */
    package com.florence.net.packet.builders;
    
    import com.florence.model.player.Player;
    import com.florence.net.OutByteBuffer;
    import com.florence.net.packet.PacketBuilder;
    import com.florence.net.packet.PacketBuilderConstants;
    import com.florence.net.packet.PacketHeader;
    
    public class LoginPacketBuilder extends PacketBuilder {
    
        public LoginPacketBuilder() {
            super(PacketBuilderConstants.LOGIN_USER_PACKET_OPCODE, PacketHeader.FIXED);
        }
    
        @Override
        public OutByteBuffer build(Player player) {
            OutByteBuffer buffer = new OutByteBuffer(Byte.BYTES);
            return buffer;
        }
    }
    This server also includes a straightforward but efficient Task system. A large issue that i've observed is the implementation of tracker variables to count ticks. Even in newer Task systems there still seems to be traces of this. I attempted to address this issue by having the Task itself manually count its own iterations. This lets us structure tasks systematically around game ticks. The better alternative being an inline blocking function, however Java is not very supportive of co-routines.

    Code:
    /*
     * Copyright (C) 2019 Dylan Vicchiarelli
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * as published by the Free Software Foundation; either version 2
     * of the License, or (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program; if not, write to the Free Software
     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
     */
    package com.florence.model.content;
    
    import com.florence.model.Animation;
    import com.florence.model.Entity;
    import com.florence.model.Graphic;
    import com.florence.model.player.Player;
    import com.florence.model.player.Player.RegionState;
    import com.florence.model.Position;
    import com.florence.task.Task;
    
    public class StandardTeleportSpell extends TeleportSpell {
    
        public static final Animation STANDARD_TELEPORT_ANIMATION = Animation.create(714, 0);
        public static final Graphic STANDARD_TELEPORT_GRAPHIC = Graphic.create(308, 0, 6553600);
        public static final Animation STANDARD_ENDING_ANIMATION = Animation.create(715, 0);
    
        public StandardTeleportSpell(Position destination) {
            super(destination, STANDARD_TELEPORT_ANIMATION, STANDARD_TELEPORT_GRAPHIC);
        }
    
        @Override
        public Task cast(Entity entity) {
            entity.setTeleported(true);
            entity.setAnimation(animation);
            return new Task(entity) {
                @Override
                public void execute() {
                    if (ticks == 2) {
                        entity.setGraphic(graphic);
                    } else if (ticks == 3) {
                        if (entity instanceof Player) {
                            Player player = (Player) entity;
                            player.setRegionState(RegionState.REBUILDING_REGION);
                        }
                        entity.setPosition(destination);
                        stop();
                    }
                }
    
                @Override
                public void cancel() {
                    entity.setAnimation(STANDARD_ENDING_ANIMATION);
                    entity.setTeleported(false);
                }
            };
        }
    }
    The code as a whole is well documented, there is some instances of redundant documentation. However, i'll often do that to simply break up larger blocks of code and make them more readable. I'm not going to list all the internal features as Github will let you view all the current code. I just wanted to provide some information in the thread. If you have any questions or concerns let me know. Hopefully someone can find this useful, even if it is simply learning a few things.
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Donator
    Esper's Avatar
    Join Date
    Jun 2011
    Age
    25
    Posts
    109
    Thanks given
    13
    Thanks received
    5
    Rep Power
    1
    nice
    Reply With Quote  
     

  4. #3  
    HYBRID JEFE
    Brett the Don's Avatar
    Join Date
    Dec 2009
    Posts
    1,801
    Thanks given
    254
    Thanks received
    297
    Rep Power
    575
    Looks nice, thanks for the release!

    All of humanity's problems stem from man's
    inability to sit quietly in a room by himself
    Reply With Quote  
     

  5. #4  
    Registered Member
    Join Date
    May 2016
    Posts
    89
    Thanks given
    0
    Thanks received
    13
    Rep Power
    9
    You don't need to put your name and the project licence in every damn source file. Just use gits standard way of licencing software. Also, we get it, you're the maintainer, stop putting "credits" in every file otherwise when people come to modify the code you end up with a contribution commit log. Its unnecessary. Also you cant licence this. Its based on software what you don't have intellectual rights for, it wouldn't hold up in any civil court.

    Edit:
    "was able to connect and disconnect 1000 connections without missing a single one." I should hope not since its using TCP.
    Reply With Quote  
     

  6. #5  
    Community Veteran

    Songoty's Avatar
    Join Date
    Dec 2007
    Posts
    2,735
    Thanks given
    205
    Thanks received
    1,019
    Rep Power
    2326
    Quote Originally Posted by kierandevvs View Post
    You don't need to put your name and the project licence in every damn source file. Just use gits standard way of licencing software. Also, we get it, you're the maintainer, stop putting "credits" in every file otherwise when people come to modify the code you end up with a contribution commit log. Its unnecessary. Also you cant licence this. Its based on software what you don't have intellectual rights for, it wouldn't hold up in any civil court.

    Edit:
    "was able to connect and disconnect 1000 connections without missing a single one." I should hope not since its using TCP.
    Most IDE's automatically put the license in each created file. And most software I've ever looked at usually has a license header in each applicable file.
    Reply With Quote  
     

  7. #6  
    Registered Member
    Join Date
    Apr 2016
    Posts
    19
    Thanks given
    3
    Thanks received
    12
    Rep Power
    69
    Quote Originally Posted by kierandevvs View Post
    You don't need to put your name and the project licence in every damn source file. Just use gits standard way of licencing software. Also, we get it, you're the maintainer, stop putting "credits" in every file otherwise when people come to modify the code you end up with a contribution commit log. Its unnecessary. Also you cant licence this. Its based on software what you don't have intellectual rights for, it wouldn't hold up in any civil court.

    Edit:
    "was able to connect and disconnect 1000 connections without missing a single one." I should hope not since its using TCP.
    Netbeans automatically adds a license header, remove it if it bothers you so much. Giving proper credits is good practice and appreciated by those who contributed. Half the servers that make use of TCP in this section can't hold 400 connections. This application uses no client side code or assets, it's not based on any "software" that I didn't have a right to use. I also think you're missing the point of the GNU license, did you even read it?

    Nothing you said made any sense. Thanks for the comment though?
    Reply With Quote  
     

  8. #7  
    Registered Member
    Join Date
    May 2016
    Posts
    89
    Thanks given
    0
    Thanks received
    13
    Rep Power
    9
    Quote Originally Posted by Private Byte View Post
    Netbeans automatically adds a license header, remove it if it bothers you so much. Giving proper credits is good practice and appreciated by those who contributed. Half the servers that make use of TCP in this section can't hold 400 connections. This application uses no client side code or assets, it's not based on any "software" that I didn't have a right to use. I also think you're missing the point of the GNU license, did you even read it?

    Nothing you said made any sense. Thanks for the comment though?
    "Half the servers that make use of TCP in this section can't hold 400 connections." Oh yeah, I forgot about them game servers that use UDP (For those who didn't get it, I'm being sarcastic)
    "I also think you're missing the point of the GNU license, did you even read it?" No, I get that the licence agreement requires it to be in each file, my point is, 1) why are you using such a verbose licence 2) why are you licencing at all?!?!?!?!
    "This application uses no client side code or assets", It doesn't matter, its built to emulate someone else's content and lets be honest, you aren't taking anyone to court if they sell this.
    "Giving proper credits is good practice and appreciated by those who contributed.", yeah, its called a contribution list.
    "Nothing you said made any sense.", thats fine, we all get confused at times.

    Code:
    //Copyright (C) 2019 
    //Dylan Vicchiarelli
    //Dylan Vicchiarelli
    //Hassan Hartley
    //Emmitt Patchell
    //Dewitt Mongold
    //Earnest Threadgill
    //Paul Traina
    //Garry Crudup
    //Reuben Gelb
    //Roscoe Saint
    //Rodrick Summerall
    //Fermin Mallet
    //Arlie Fender
    //Raul Copper
    //Nathanial Hoar
    //Marc Awad
    //Alonzo Ishikawa
    //Al Lachermeier
    //Rosario Buckner
    //Craig Witt
    //Antonia Dobbs
    //Gaylord Kubik
    //Gail Conner
    //Jonah Lumpkins
    //Curtis Alvelo
    //Jonas Timms
    //Amado Henson
    //Eli Stoltzfus
    //Geoffrey Pinson
    //Ramon Bonacci
    //Alec Warfield
    //Sheldon Housand
    //Arturo Feinberg
    //Morris Brumsey
    //Stacey Lukach
    //Roderick Honahni
    //Collin Zimmer
    //Walker Sluss
    //Britt Ricketson
    //Barry Siller
    //Vincent Guilbert
    //Chang Sundstrom
    //Cleveland Duron
    //Aaron Hereford
    //Doug Shane
    //Sydney Suder
    //Ben Simard
    //Jesus Amburgey
    //Neal Najera
    //Oliver Niver
    //Earl Steinhauser
    //Reed Barbieri
    //Lenny Faw
    //Faustino Osterhoudt
    //Douglass Wesolowski
    //Zack Stansbury
    //Emory Hubbell
    //Napoleon Livermore
    //Kermit Wigington
    //Rickey Wison
    //Jarod Schwantes
    //Charley Kohan
    //Wilburn Mcpartland
    //Edgardo Rustin
    //Abram Beachy
    //Garth Mayhall
    //Jae Sackett
    //Maria Goold
    //Virgil Privett
    //Ralph Hurrell
    //Stephan Proctor
    //Jake Magers
    //Darin Pietila
    //Irving Muldrow
    //Clyde Hofman
    //Elias Aikens
    //Burl Suen
    //Fletcher Rainer
    //Mariano Litle
    //Simon Breiner
    //Terence Kemmer
    //Gil Hoaglin
    //Gregorio Worth
    //Wilbur World
    //Zachary Alberico
    //Hank Ekhoff
    //Maynard Kelm
    //Myron Gutter
    //Ricky Favorite
    //Clifton Clyburn
    //Isaias Tooley
    //Lindsay Haapala
    //Miles Lohmann
    //Bryce Zirbel
    //Renato Finamore
    //Doug Holthaus
    //Mack Fairclough
    //Emmett Snuggs
    //Salvatore Allensworth
    //Mac Brodt
    //Felix Murrah
    //Emery Muncy
    
    public class Main { // Copy right my man Java
        public static void main(String[] args) { // CopyRiht shout out to ya boi eclipse
    		System.out.println("Hello world!"); // Copyright 2019 MaRk DiD tHis
    	} // Cant forget notepad
    } // Windows XP
    [Only registered and activated users can see links. ]
    *cough* Git repository contributors *cough*
    Reply With Quote  
     

  9. #8  
    Registered Member
    Join Date
    Apr 2016
    Posts
    19
    Thanks given
    3
    Thanks received
    12
    Rep Power
    69
    Quote Originally Posted by kierandevvs View Post
    "Half the servers that make use of TCP in this section can't hold 400 connections." Oh yeah, I forgot about them game servers that use UDP (For those who didn't get it, I'm being sarcastic)
    "I also think you're missing the point of the GNU license, did you even read it?" No, I get that the licence agreement requires it to be in each file, my point is, 1) why are you using such a verbose licence 2) why are you licencing at all?!?!?!?!
    "This application uses no client side code or assets", It doesn't matter, its built to emulate someone else's content and lets be honest, you aren't taking anyone to court if they sell this.
    "Nothing you said made any sense.", thats fine, we all get confused at times.
    Your sarcasm wasn't apparent, you just seem desperate for credibility. Once again, Netbeans by default will set license headers, I simply chose an open source license that fit the bill. If you're offended feel free to remove it, nobody cares. The act of emulation isn't illegal, that being said, I wouldn't really care if someone attempted to sell this. I doubt they would get very far.

    That long text of authors is irrelevant, I have three author tags in this entire application. (on 3 files?) I can't tell if you're an idiot or just trolling me at this point. I developed this offline (Coincidentally during travel around Italy, then a little bit back home. Hence the name), I only uploaded it to Git for the release.
    Reply With Quote  
     

  10. Thankful user:


  11. #9  
    Registered Member
    Join Date
    Dec 2011
    Posts
    670
    Thanks given
    141
    Thanks received
    149
    Rep Power
    114
    Looks nice. Starred, will be following the repo.

    Maybe add a TODO file?
    Reply With Quote  
     

  12. #10  




    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    25
    Posts
    15,975
    Thanks given
    7,020
    Thanks received
    11,572
    Rep Power
    5000
    Quote Originally Posted by kierandevvs View Post
    You don't need to put your name and the project licence in every damn source file.
    imagine being that entitled that you tell some1 what to do with their own code base that they wrote with their own time


    Quote Originally Posted by kierandevvs View Post
    Just use gits standard way of licencing software.
    git doesn't have a "standard" way of licensing, git has nothing to do with how you license your software


    Quote Originally Posted by kierandevvs View Post
    Its unnecessary.
    arguable, if he wants to license it then including the license in every file will surely hold up better in court - lots of opensource projects do this for this reason, similarly lots of commercial software includes the license in every file for the same reasons.


    Quote Originally Posted by kierandevvs View Post
    Also you cant licence this. Its based on software what you don't have intellectual rights for, it wouldn't hold up in any civil court.
    completely false. server-side code written by himself (i.e. not code based on or copied from the client, which the majoritty of the server software would be) is absolutely his intellectual propertly and absolutely would hold up in any court.


    Quote Originally Posted by kierandevvs View Post
    No, I get that the licence agreement requires it to be in each file, my point is, 1) why are you using such a verbose licence
    because its his intellectual property and he can choose how he wants it to be used.


    Quote Originally Posted by kierandevvs View Post
    2) why are you licencing at all?!?!?!?!
    if he doesn't license it then [Only registered and activated users can see links. ].

    "Unless you include a license that specifies otherwise, nobody else can copy, distribute, or modify your work without being at risk of take-downs, shake-downs, or litigation."


    Quote Originally Posted by kierandevvs View Post
    It doesn't matter, its built to emulate someone else's content and lets be honest, you aren't taking anyone to court if they sell this.
    it being an emulator is completely irrelevant, it's still his code and his intellectual property. he can absolutely take somebody to court if they violate the terms of this license.
    Last edited by Scu11; 03-15-2019 at 09:16 PM.




    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)

Similar Threads

  1. Custom Gameframe Framework!
    By Inside Sin in forum Graphics
    Replies: 17
    Last Post: 05-01-2009, 09:42 PM
  2. Wrote my Framework in a day.
    By Vastiko in forum RS 503+ Client & Server
    Replies: 9
    Last Post: 09-18-2008, 10:49 PM
  3. My Framework
    By Vastiko in forum RS 503+ Client & Server
    Replies: 1
    Last Post: 09-18-2008, 03:42 PM
  4. My own Framework?
    By Vastiko in forum RS 503+ Client & Server
    Replies: 10
    Last Post: 09-15-2008, 09:00 AM
  5. 503 w/ 317 framework?
    By Simplicity✔ in forum RS 503+ Client & Server
    Replies: 22
    Last Post: 08-16-2008, 04:59 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
  •