!!

Register new account or login on the forum!

To have a full access of the forum please create a new account! Click here or login with your account Click here.

collapse

Support us!

Support membergroup

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 9
  • Dot Spiders: 0
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

Author Topic: Development workflow (hot deploy)  (Read 1361 times)

0 Members and 1 Guest are viewing this topic.

Offline ruke

  • *
  • Posts: 2
  • Karma: +0/-0
  • L2jFrozen Newbie
Development workflow (hot deploy)
« on: October 24, 2017, 04:17:12 PM »
Note: I wrote this guide for l2jserver, but it should work the same for Frozen. Let me know if you run into issues.

Hi, I just recently started working on L2J and while I was implementing a few custom features in the server I found the development workflow quite awful since I had to make quite a lot of steps to actually see my changes: change the code -> compile -> update files -> shutdown server -> start server -> login again -> see the changes in game.

So, I wanted a change, I only wanted to follow these steps: change code -> compile -> see changes in game. And luckily I was able to accomplish it.

What do you need?
- A working server
- The sources of the l2jserver/frozen (obviously)

Steps

1 - In your source folder, you need the gameserver/config and gameserver/data folders from YOUR WORKING SERVER. You can do this by copying the folders or create a symbolic link so any changes you made to those folders are reflected without having to copy/paste again.



2 - Download DCEVM (light) for Java 8u144 (build 2)

3 - Download HotswapAgent

4 - Download JDK 8u144

5 - Install JDK 8

6 - Open a command line with administrator permissions:



7 - In your command line, go to the folder where you downloaded DCEVM (light) for Java 8u144 (build 2) and run it:

Code: [Select]
$ cd path/to/your/DCEVM (light) for Java 8u144 (build 2)
$ java -jar DCEVM-8u144-installer.jar

8 - Once the application opens, select your JDK 8 and click Install DCEVM as altjvm:



Perfect, almost done!

9 - Open your IDE, and go to the Run configurations



10 - Complete with the following:

Name: GameServer Hotswap

Main class: net.sf.l2j.gameserver.GameServer (if you cannot find it, try searching for gameServer.GamesServer)

VM Options: -XXaltjvm=dcevm -javaagent:PATH\TO\hotswap-agent.jar

JRE: Make sure you have selected JDK 1.8.0.144



11 - Go to your gameServer.GameServer class, and make sure the logs line are commented:



12 - Start your loginServer as usual.

13 - Go to your IDE, and run GameServer Hotswap (from step 10)

14 - Your server should be up, try login with a character.

15 - If you succeed, perfect, now the exciting part, let's make a tiny change. Go to java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java class and add this line to runImpl method, in the line 108:

Code: [Select]
activeChar.sendMessage("Hello from HOTDEPLOY!");
16 - Save the file, and rebuild the project:



You should have a message that a class was updated.
Great, our change is already on, go to your server, login with a character and:



Did you notice? no downtime!

Hope it helps. Happy to help if anyone cannot do it.

Have a good day.

Offline ReynalDev

  • *
  • *
  • Posts: 209
  • Karma: +0/-0
  • Gender: Male
  • Freelancer
    • ReynalDev
Re: Development workflow (hot deploy)
« Reply #1 on: October 24, 2017, 07:51:06 PM »
Wow!! Nice guide but this only work when you are in development because in a real server (Production) doesn't have any sense install all those programs.  ;D

Offline ruke

  • *
  • Posts: 2
  • Karma: +0/-0
  • L2jFrozen Newbie
Re: Development workflow (hot deploy)
« Reply #2 on: October 25, 2017, 12:54:36 AM »
Right, this is only for development ^^

Offline ReynalDev

  • *
  • *
  • Posts: 209
  • Karma: +0/-0
  • Gender: Male
  • Freelancer
    • ReynalDev
Re: Development workflow (hot deploy)
« Reply #3 on: October 25, 2017, 01:07:36 AM »
Right, this is only for development ^^

Thanks for share!  ;)

Offline Nefer

  • *
  • Posts: 276
  • Karma: +0/-0
  • Gender: Male
  • Electric & Electronic engineer
    • Interlude c6 project
Re: Development workflow (hot deploy)
« Reply #4 on: October 25, 2017, 09:13:27 AM »
Nice work, i always accept guide from our community.  ;)

 


* l2jfrozen shoutbox

Refresh History
  • Please don't use the shoutbox for question, create new topic for it!
  • maytord: data pack l2jfrozen
    May 02, 2021, 03:54:56 AM
  • maytord: data pack l2jfrozen
    May 02, 2021, 03:54:42 AM
  • Damon: [link] - INTERLUDE server FILES (Pack) Strix-Platform (Guard) protection 15% OFF: [link] Recommend our files and get a REAL MONEY: [link]
    February 17, 2021, 09:54:57 AM
  • Damon: [link] - INTERLUDE server FILES (Pack) Strix-Platform (Guard) protection 15% OFF: [link] Recommend our files and get a REAL MONEY: [link]
    February 17, 2021, 09:54:53 AM
  • Damon: [link] - INTERLUDE server FILES (Pack) Strix-Platform (Guard) protection 15% OFF: [link] Recommend our files and get a REAL MONEY: [link]
    February 17, 2021, 09:54:50 AM
  • Damon: [link] - INTERLUDE server FILES (Pack) Strix-Platform (Guard) protection 15% OFF: [link] Recommend our files and get a REAL MONEY: [link]
    February 17, 2021, 09:54:33 AM
  • MarceloW: Good morning, is there anyone with this online rev?
    February 13, 2021, 12:31:04 PM
  • SnoOpee: hello, test server online?
    February 12, 2021, 01:39:41 PM
  • Unplated: Hi Anyone still here? :)
    January 29, 2021, 01:02:45 AM
  • CTGavesT: hello
    January 10, 2021, 01:50:13 PM
  • raesko: hi where i can download clean system for frozen server ? :)
    January 09, 2021, 09:51:28 PM
  • L2Elita: hi . very happy to see again frozen alive.anyone who knows from centos please?
    November 02, 2020, 05:15:04 PM
  • pontikomikroulhs: UndergrOundcOdeS can you send me a pm i need you help ..thanks!
    September 26, 2020, 03:21:49 PM
  • Gazlynns: UndergrOundcOdeS, maybe you have and server? :)
    August 18, 2020, 08:37:56 AM
  • leviathan: leviathan
    August 14, 2020, 10:23:28 PM
  • UndergrOundcOdeS: Yeah! why not? :D
    August 14, 2020, 01:38:52 AM
  • Gazlynns: Hello. Did anyone still using l2jfrozen 1132? :)
    August 10, 2020, 10:46:58 PM
  • sync: Buenas, algun me podria orientar como compilo el datapack? No vienen con el build y no se como compilarlo sin build Gracias!
    June 09, 2020, 05:22:23 AM
  • Joniredbullgr: plz there is problem one Olympiad shave maches.
    June 06, 2020, 01:08:43 PM
  • akken12: hi why sometime when i use cp pots it reuse and when i tp/restart etc goes from start?
    May 25, 2020, 08:52:14 AM