Jump to content

aCis - another CRAPPY interlude server


Tryskell

Recommended Posts

o.O I'm surprised that you use greek words to your posts.

lol?

 

I liked json since you first mentioned it Seth, because it's easier to use and you can simply save a whole .json file to a list(you can do it in jaxb too, but it's kinda complicated).

Link to comment
Share on other sites

JSON is a very good alternative to static XML datapack and I think it can outperform XML loading in L2j, we need benchmark tests anyway

 

Tutorial: http://www.mkyong.com/java/json-simple-example-read-and-write-json/

 

XML to JSON: http://www.utilities-online.info/xmltojson

Link to comment
Share on other sites

JSON is a very good alternative to static XML datapack and I think it can outperform XML loading in L2j, we need benchmark tests anyway

 

Tutorial: http://www.mkyong.com/java/json-simple-example-read-and-write-json/

 

XML to JSON: http://www.utilities-online.info/xmltojson

its all about managing json. Take a look at jackson @ codehouse

Link to comment
Share on other sites

Look at this:

 

http://pastebin.com/JHT4ACBi

 

And how it's loaded:

 

public void load()
{
	File f = new File("./data/json/teleports.json");
	if (!f.exists())
	{
		_log.severe("TeleportLocationTable: teleports.json could not be loaded: file not found");
		return;
	}

	List<L2TeleportLocation> temp = JSONParser.getInstance().loadList("data/json/teleports.json", L2TeleportLocation.class);

	for (L2TeleportLocation tl : temp)
	{
		_teleports.put(tl.getTeleId(), tl);
	}

	_log.info("TeleportLocationTable: Loaded " + _teleports.size() + " templates.");
}

 

While in xml(without using jaxb):

 

public void load()
{
	try
	{
		File f = new File("./data/xml/teleports.xml");
		Document doc = XMLDocumentFactory.getInstance().loadDocument(f);

		Node n = doc.getFirstChild();
		for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
		{
			if (d.getNodeName().equalsIgnoreCase("teleport"))
			{
				NamedNodeMap node = d.getAttributes();

				L2TeleportLocation teleport = new L2TeleportLocation();
				teleport.setTeleId(Integer.valueOf(node.getNamedItem("id").getNodeValue()));
				teleport.setLocX(Integer.valueOf(node.getNamedItem("loc_x").getNodeValue()));
				teleport.setLocY(Integer.valueOf(node.getNamedItem("loc_y").getNodeValue()));
				teleport.setLocZ(Integer.valueOf(node.getNamedItem("loc_z").getNodeValue()));
				teleport.setPrice(Integer.valueOf(node.getNamedItem("price").getNodeValue()));
				teleport.setIsForNoble(Integer.valueOf(node.getNamedItem("fornoble").getNodeValue()) == 1);

				_teleports.put(teleport.getTeleId(), teleport);
			}
		}
	}
	catch (Exception e)
	{
		_log.severe("TeleportLocationTable: Error while creating table" + e);
	}
	_log.info("TeleportLocationTable: Loaded " + _teleports.size() + " templates.");
}

 

 

Also when teleports.xml rewriten to teleports.json it was like half size.

Link to comment
Share on other sites

Also when teleports.xml rewriten to teleports.json it was like half size.

 

Of course.

 

HelperBuffTable using json.

 

private void load()
{
	JsonService service = JsonService.getInstance();
	_helperBuff = service.loadList("data/json/helper_buffs.json", L2HelperBuff.class);

	for (L2HelperBuff buff : _helperBuff)
	{
		// Calulate the range level in wich player must be to obtain buff from Newbie Helper
		if (!buff.isMagicClassBuff())
		{
			if (buff.getLowerLevel() < _physicClassLowestLevel)
			{
				_physicClassLowestLevel = buff.getLowerLevel();
			}

			if (buff.getUpperLevel() > _physicClassHighestLevel)
			{
				_physicClassHighestLevel = buff.getUpperLevel();
			}
		}
		else
		{
			if (buff.getLowerLevel() < _magicClassLowestLevel)
			{
				_magicClassLowestLevel = buff.getLowerLevel();
			}

			if (buff.getUpperLevel() > _magicClassHighestLevel)
			{
				_magicClassHighestLevel = buff.getUpperLevel();
			}
		}
	}

	_log.info("Helper Buff Table: Loaded " + _helperBuff.size() + " Templates.");
}

Link to comment
Share on other sites

yet json is hard to edit, hard to read and just a nightmare to edit when it involves big stuff, json is a web language in general and should be used on the web only

Link to comment
Share on other sites

yet json is hard to edit, hard to read and just a nightmare to edit when it involves big stuff, json is a web language in general and should be used on the web only

Well, it's not that bad. Actually you can't say it should only be used on web apps, since it is created in order to make a faster xml service(even the package in jackson lib is com.fasterxml lol). It's just kinda complicated, but really efficient too.

Link to comment
Share on other sites

Well, it's not that bad. Actually you can't say it should only be used on web apps, since it is created in order to make a faster xml service(even the package in jackson lib is com.fasterxml lol). It's just kinda complicated, but really efficient too.

 

The creators of json said themselfs that json was implemented to replace XML on the web nowhere else, in l2j you need validation you need clear understanding of every element and you also need structure which json doesnt have.

 

XML maybe harder to parse but when you check on the outcome it provides a better result for gameserver usage than json ever could.

Link to comment
Share on other sites

The creators of json said themselfs that json was implemented to replace XML on the web nowhere else, in l2j you need validation you need clear understanding of every element and you also need structure which json doesnt have.

 

XML maybe harder to parse but when you check on the outcome it provides a better result for gameserver usage than json ever could.

Xml though is useful only if you use jaxb(which is kinda difficult too when you are trying to unmarshal/marshal a list).

Link to comment
Share on other sites

Xml though is useful only if you use jaxb(which is kinda difficult too when you are trying to unmarshal/marshal a list).

jaxb made xml easy actually, its just a matter of understanding the annotations, tho its kind of annoying making so many classes to use them as protocols just to pass the data to another holder.

 

Also XML was done by  W3C, who wanna guess what they do in particular?

The only downfall of json is that they dont have time stamps.

And its easy to read, in fact easyest to read and write, basically there are thousands of editors.

 

Link to comment
Share on other sites

Guys, good alternative to xml can be yaml, but not shit json.

hahahaha its the same thing, im crying right nou of laughter hahahaha

 

Also ill tell you why YAML should be always left as a config. Indent dependency.

Link to comment
Share on other sites

Guys, good alternative to xml can be yaml, but not shit json.

You are not even using jaxb to load xml in aCis and you tell us about replacing it?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • While not particularly active over the years, I've been around for as long as I could remember, so here are my 2 cents too. On top of what has already been said, I'd like to touch on a few thing that might be improved upon. While it is easy to notice and say "there's lack of engagement" or "community has outgrown the ganre", I've seen numerous forums get forgotten and die while others continue to thrive to this day. The main issue, in my humble opinion, is that the sector has been commercialised to an unsustainable extent. When nobody is willing to share anything, even if it is just a rework of an open-sourced or already-shared resource, the sense of "community" gets deminished. Now back on the pressing matter. From what I've seen, the lack of engagement could be circumvented with a redesign and functionality expansion that would/could/should include: - a built-in chat functionality. - incentives for engagement/interaction, ideas of which I'll list as separate pointers, as not to limit your creativity. But just as an example, from a more user/human perspective, having an easily identifiable way to get into "the club of the cool kids on the block", figuratively speaking, is an incentive on its own. - separation of the reputation into reactions and reputation. One to be used to posts, such as up-vote and what not, while the other to be awarded as means of appreciation. - automated ranks with actual benefits/perks, not like the current ones providing nothing. - the ability to hide text for user/group of users, not just premium/no premium. - increased visibility of the HOT topics and the RECENTLY ACTIVE threads/posts. Can be also expanded to most liked posts, etc. ps.: I'll update my post when I have some free time on my hands.
    • There was no way I didn't refunded or delivered files. I don't see You on my conrtact list on Discord, can You send me a message or at least tell me for what project was this updater? I always resolve if I can't deliver on time or customer bailes.
    • @rlfem123  I’m a web developer, and I work with technologies like Next.js and React. In the last 10 years, L2 Rankzone is the only one I’ve seen that actually did something different. All the others seem to have the same source code with different templates. L2 Hopzone also did an upgrade and, for the front end, is using Vue.js. Regarding web development, we have reached a point where you can easily create websites using libraries or frameworks. Simply pick one and start working. You will learn as you go. Personally, I prefer to build my back-end APIs in Laravel if it’s a big project since the ecosystem offers everything. For smaller projects, I choose Go. Then I use either React or Next.js to call my APIs, depending on the case. Next.js also supports Server-Side Rendering (SSR) if you want to hide some things from the client. Additionally, CSS libraries have almost everything you need nowadays to start building quickly with browser compatibility. You can seriously build an L2 website with ranks, a good design, and even a simple login/register system in just 3 days. Here are some CSS libraries I personally work with: https://tailwindui.com/components   https://ui.shadcn.com/   https://mui.com/material-ui/ Regarding the top websites i dont thing its worth the time and effort.  Its pretty simple to build one and the market is already bloated. In addition l2 is dying so i suggest to build top sites for many games.  THe main problem is not the build process rather the marketing one. You can build the most awesome website iin terms of functionality but if you marketing is week you wont exceed 10 concurrent users. 
    • Good evening from me as well. I wouldn't recommend anyone, no matter how much love they have for the game, to try to revive it, not only because of the times but also because of the community (people who used to spend 15 hours grinding now qq for everything when they have auto-farm enabled 24/7... ) .  All the effort will be in vain. I have given all I had to this game. I have spent an incredible amount of time and over 20k the past 6 years, and the money can go to hell, but the time doesn't come back, I almost literally didn't get cancer... Also, very few people are worth collaborating with, all the rest are scammers and traitors. Unfortunately, only the projects that have been in the background for years do well.   P. S: "Once upon a time they used to be players now only complainers left" 
    • hello i use acis 401 In the video that you uploaded, the name is not visible, but it appeared to me I upload a screenshot so you can understand what I mean how can i fix it? https://prnt.sc/kTET9oxF4fos
  • Topics

×
×
  • Create New...