Jump to content

Recommended Posts

Posted (edited)

idFactory generates sequential IDs, you need something more random, you can use its IDs as seeds btw, but it will consume available IDs from server objects so you still need a workaround.

 

Ids are released when coupon is used, and the IdFactory grows when needed.

 

Any item on inventory uses a id generated from here, and it never posed any issue, being 100 or 1000 players. So for few coupons per players...

 

Ideas :

 

- Instead of the id of the coupon, it should show generic information based on coupon information : "Gold Coupon - B grade". Id is supposed to be internal value and not being seen from player view anyway.

- You should also add a Config for maximum amount of coupons per player, 0 means unlimited amount (can be set as default).

- Add a way for player to delete a coupon (let's say he doesn't want a nograde coupon anymore, he can delete it).

- Add a limit to open per day (can be a global task like pvpflag, resetted at 0:00).

Edited by Tryskell
Posted

Ids are released when coupon is used, and the IdFactory grows when needed.

 

Any item on inventory uses a id generated from here, and it never posed any issue, being 100 or 1000 players. So for few coupons per players...

 

Instead of the id of the coupon, it should show generic information based on coupon information : "Gold Coupon - B grade". Id is supposed to be internal value and not being seen from player anyway.

players cant see the id since the name of the coupon (this random string) is generated from this id

private static String getCouponName(int id) //the idFactory id
{
	StringBuilder sb = new StringBuilder();
	String number = String.valueOf(id);
	
	for (int i = 0; i < number.length(); i++)
	{
		int j = Character.digit(number.charAt(i), 10);
		char Char = (char) (j + (Rnd.get(65, 81))); //65 == A , 90 == Z
		sb.append(Char);
	}
	
	return sb.toString();
}

i find it cool :P

Posted (edited)

...

 

The point was to use directly the objectId to avoid String generation/manipulation and to assure the uniqueness of the id, and use it only internally for server purpose. :P

 

I edited previous post for additional ideas.

Edited by Tryskell
Posted

Tryskell,

The good thing is that your ideas are awesome.

The bad thing is, finally this share will belong to you xD

 

I'm gonna listen your advice :P

Posted (edited)

Tryskell,

The good thing is that your ideas are awesome.

The bad thing is, finally this share will belong to you xD

 

I'm gonna listen your advice :P

 

Well, if that can learn you one thing or two and in same time your custom becomes more performant/shorter/universal, everyone is winning : users who will use it, and you since you get some knowledge from it.

 

I'm not sure it's a "bad thing" than you know how I "see" your custom, notably on the construction side. A good developer is a lazy developer, so everything must be as simple as possible. First because it's annoying to debug, second because if you re-read your code in some years you will be mad of yourself.

 

Let's say I protect your mental health of your future self from your actual self :D.

 

----

+       int gradeLevel = player.getSkillLevel(239);
+      
+       coupon.setGradeType(gradeLevel == -1 ? 0 : gradeLevel);

>

+      coupon.setGradeType(Math.max(0, player.getSkillLevel(239)));

On the next aCis rev 371, getSkillLevel will return 0 by default not -1 anymore so you could drop the Math stuff and use directly player.getSkillLevel(239).

 

----

 

couponName (and the generation of it) can be dropped, if you generate the name directly based on the coupon. I see only one place where the name is visually called or even used, and it's on the floating list listing players coupons. The StringBuilder can directly generate the coupon name based on Coupon informations, as I said "Golden Coupon - X grade" is enough for the player. The id is used by the server to identify each coupon.

 

----

+       if (coupons.contains(coupon))
+       {
+           coupons.remove(coupon);

>

 

remove can be directly called on the if, since removing an Element returns a result under a boolean.

 

https://docs.oracle.com/javase/7/docs/api/java/util/List.html#remove(java.lang.Object)

Edited by Tryskell
Posted (edited)

Well, if that can learn you one thing or two and in same time your custom becomes more performant/shorter/universal, everyone is winning : users who will use it, and you since you get some knowledge from it.

 

I'm not sure it's a "bad thing" than you know how I "see" your custom, notably on the construction side. A good developer is a lazy developer, so everything must be as simple as possible. First because it's annoying to debug, second because if you re-read your code in some years you will be mad of yourself.

 

Let's say I protect your mental health of your future self from your actual self :D.

Sure! i'm learning by my mistakes that's obvious ... and thank you for all your suggestions. about this: A good developer is a lazy developer

I do not agree :D why a good dev should be lazy? That is the best part of this thing so... (just my opinion)

 

P.s i'm thinking to remove as you said the name and use direcly the sb but there is one problem. 

 

commands like /showcoupons or /deletecoupons or even npcs,html / alert messages etc can be used without any issue 

but...

combobox doesn't accept spaces.. so will fucked up (Golden-Coupon-B-Grade) ? :D

also there is another problem there. The bypass for the redeem is sending the name 

Coupon coupon = player.getCouponsByName(couponName);

if the combobox will contains > 1 example Golden . how the manager can delete the coupon(based on id) ? Cant even add something with placeholder to keep these id's

Edited by melron
Posted (edited)

 

Sure! i'm learning by my mistakes that's obvious ... and thank you for all your suggestions. about this: A good developer is a lazy developer

I do not agree :D why a good dev should be lazy? That is the best part of this thing so... (just my opinion)

 

P.s i'm thinking to remove as you said the name and use direcly the sb but there is one problem. 

 

commands like /showcoupons or /deletecoupons or even npcs,html / alert messages etc can be used without any issue 

but...

combobox doesn't accept spaces.. so will fucked up (Golden-Coupon-B-Grade) ? :D

also there is another problem there. The bypass for the redeem is sending the name 

Coupon coupon = player.getCouponsByName(couponName);

 

You can use coupon id instead of name for all inner, server checks.

 

About combobox you can design it like [Gold]Coupon(A) or generate a whole page for coupons like I did with bookmarks (since you can have unlimited amount of coupons oyu're probably screwed with your combobox if you got 20, 30 coupons).

Edited by Tryskell
Posted (edited)

You can use coupon id instead of name for all inner, server checks.

 

About combobox you can design it like [Gold]Coupon(E) or generate a whole page for coupons like I did with bookmarks (since you can have unlimited amount of coupons oyu're probably screwed with your combobox if you got 20, 30 coupons).

no i edited all those things u told me about the max coupons and limits per day (this task) etc.

now im trying to think other ways to do that :P

 

if the bypass contains (GOLD)Coupon[C] for example i can just check the category and delete a random coupon with the same category. :P

Edited by melron
Posted (edited)

no i edited all those things u told me about the max coupons and limits per day (this task) etc.

now im trying to think other ways to do that :P

 

if the bypass contains (GOLD)Coupon[C] for example i can just check the category and delete a random coupon with the same category. :P

 

I don't rem if a combobox can have a different value than the value passed on the bypass, if not the best is to generate a specific HTM for coupons, with clickable links (like //bk system). At least you control what you show, and you can have an unlimited amount of coupons if someone decide to put configs to 0, since you can introduce a paging system aswell (once again, bookmark system :D).

Edited by Tryskell
Posted (edited)

I don't rem if a combobox can have a different value than the value passed on the bypass, if not the best is to generate a specific HTM for coupons, with clickable links (like //bk system). At least you control what you show, and you can have an unlimited amount of coupons if someone decide to put configs to 0, since you can introduce a paging system aswell (once again, bookmark system :D).

So the manager is useless - can be removed  :D Since if the system will work like bookmark's i can add 2 linked texts redeem,delete and ofc the name of the coupon as linked that will show all the possible rewards :P

Edited by melron
Posted (edited)


+ if (coupons.contains(coupon))

+ {

+ coupons.remove(coupon);

on ConcurrentHashMap you don't need to check for contains on ( Map )

but and on Set i think don't have difference ( try it for better performance )

 

Edited by pirama
Posted

 

on ConcurrentHashMap you don't need to check for contains on ( Map )
but and on Set i think don't have difference ( try it for better performance )

 

alread fixed pirama thank you :) im waiting to finish all the new things to release the update

Posted (edited)

alread fixed pirama thank you :) im waiting to finish all the new things to release the update

i don't know if and tryskel said the same

i see only the code with + and i don't read old post

Edited by pirama
Posted (edited)

i don't know if and tryskel said the same ( bad english sorry ) 

Yeah tryskell told me about how remove works some posts above

 

[GR] Ούτε γνωρίζω καλά, τουλάχιστον το παλεύουμε  :P

Edited by melron
Posted (edited)

Main post updated:

 

  • Redeem manager dropped
  • /coupons command now is available
  • the coupons menu contains : remove,redeem and reward list
  • added daily limit 
  • task manager running and the limit will be lifted the time you will set in configs
  • new video uploaded
  • new html files uploaded
  • added 1 column in characters table
Edited by melron

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

    • sql procedure missed and wrong...fixed it...ZOUMHS 
    • Hello Dexters! https://lineage2dex.com    This is pre-announcing of NEW season server, so we want to share some key points of it. Full details with road map, patch notes we will announce a bit latter Opening September 27 at 19:00 (UTC +3) Open Beta Test from September 23 What’s New This Season?, This is just a short preview of the most exciting changes and updates. A patch note with balance change will be posted later in this thread – one topic with all patchnotes history from 2022 year EXP/SP x25 - Over the past few seasons, our servers were drifting closer to a mid-rate style. And hard to call it now pure PVP server. That’s why we’ve reduced EXP/SP rates from x50 to x25 – making progression smoother, more balanced, and more in line with the mid-rate identity., Improved Olympiad matchmaking – opponents will be matched by strength, making feeding much harder., K/D stats for CC – track your real impact!, New In-Game Shop Interface - no more running to NPCs for supplies – buy everything directly from the interface. NPC Astarte will now only handle services like WH, sales, LS insertion, etc., Balance Adjustments - small but important tweaks for a smoother PvP experience (details in patch notes)., Replica Instance System Reworked - upgrading replicas now requires not only fragments but also real jewellery from B to S grades. You can choose from 3 instance types: PvP Instance – biggest rewards (everyone spawns together for mass PvP)., CC Instance – private instance for your CC., Party Instance – private instance for your party., , Dino Island Returns - back by popular demand: Dark Zone (PvP) and Light Zone (PvE)., Newbie Pass Questline - available at character creation – helps you get familiar with the server and make start progression faster., Clan members taxation system, Full announce - read on forum, https://forum.lineage2dex.com/threads/16723/ (edited)   We’re excited to show you how the Newbie Path will look on the Seasonal Server and share a few details about it. The Newbie Path is designed to help new players on Dex adapt more easily on project. While it won’t reveal the full content of the game, it will greatly assist during the early stages of your journey. But it’s not just for newcomers! Even veteran players will find it useful — completing Newbie Path steps will grant you small progression boosts and extra rewards(exp boosts, some gear, potions etc). Definitely worth using! You’ll be able to test the full Newbie Path system yourself during the Open Beta, launching on September 23rd!
    • 📢 [OFFICIAL ANNOUNCEMENT] 🔥 Lineage 2 Interlude x10 Craft-PvP 🔥 🎮 Grand Opening — September 19 @ 19:00 [UTC +2] 🧪 Open Beta — September 15 @ 19:00 [UTC +2]    🌐 Full server description - https://lineage2.ms/en/wiki 💥 Why Interlude x10 Craft-PvP? ✅ GM Shop up to B-Grade + Full Buffs — get straight to action, no pointless grinding. ✅ Unique Geodata & Geopathfinding Engine — smooth, tactical, and truly next-gen. ✅ Two Client Options — play in Classic or Interlude style. ✅ No Pay-to-Win — donations don’t break the balance. ✅ 1+1 Mode Enabled — max 2 windows, only 1 active = no box armies. ✅ Bot-Free Zone — advanced protection + non-intrusive popup captchas. ✅ No GM Interference — fair, competitive PvP environment. ✅ No Wipes — your progress is safe. ✅ Truly International — global reach, not just CIS players. 🛡 2nd Season. Stronger, Smarter, Updated. 🎯 Pure Craft-PvP. 🌍 Real Competition. 📅 Mark your calendars. Tell your clan. Invite your friends. Let’s make this season legendary. 💪 https://discord.gg/lineage2ms
    • As far as I know, L2Gold stated (unofficially) that closed for legal reasons. Although, my estimation is that it had reached such low popularity (believe me I know, I played till the last day), so they closed it because of that. As for "other" copies or w/e. I believe that everyone has the right to do what they think is best.  I have to say, I find your claims a bit exaggerating. Many servers have done a good job at recreating such a server. There are actually leaked files of C4 L2Gold (L2OFF) so many owners started working from there (L2Gold.cc (old Avellan), L2Gold.in, L2Gold.co etc.) There are other owners that took the idea 1 step further, adapting L2Gold in higher Chronicles and started working on a brand-new style with old features along. @Trance @Brado @To4kA (those are some of the owners that I can think of right now). I think you should re-think your opinions and don't judge them all together. Many of the servers you've mentioned has actually done a decent job and tried to take the brand, one step further. The argument here is that everyone should do what they want. Community will judge if it's good or bad.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock