Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 11-16-2008, 07:57 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,447
Default quest::collectitems

all credit for this goes to aza77, i'm just post it before it gets lost:

questmgr.cpp

Code:
int QuestManager::collectitems_processSlot(sint16 slot_id, uint32 item_id,
	bool remove)
{
	ItemInst *item;
	int quantity = 0;
 
	item = initiator->GetInv().GetItem(slot_id);
 
	// If we have found matching item, add quantity
	if (item && item->GetID() == item_id)
	{
		// If item is stackable, add its charges (quantity)
		if (item->IsStackable())
		{
			quantity = item->GetCharges();
		}
		else
		{
			quantity = 1;
		}
 
		// Remove item from inventory
		if (remove)
		{
			initiator->DeleteItemInInventory(slot_id, 0, true);
		}
	}
 
	return quantity;
}
 
// Returns number of item_id that exist in inventory
// If remove is true, items are removed as they are counted.
int QuestManager::collectitems(uint32 item_id, bool remove)
{
	int quantity = 0;
	int slot_id;
 
	for (slot_id = 22; slot_id <= 29; ++slot_id)
	{
		quantity += collectitems_processSlot(slot_id, item_id, remove);
	}
 
	for (slot_id = 251; slot_id <= 330; ++slot_id)
	{
		quantity += collectitems_processSlot(slot_id, item_id, remove);
	}
 
	return quantity;
}
questmgr.h non-protected area:

Code:
int collectitems(uint32 item_id, bool remove);
int collectitems_processSlot(sint16 slot_id, uint32 item_id, bool remove);
perlparser.cpp

Code:
XS(XS__collectitems);
XS(XS__collectitems)
{
	dXSARGS;
	if (items != 2)
		Perl_croak(aTHX_ "Usage: collectitems(item_id, remove?)");
	
	uint32 item_id = (int)SvIV(ST(0));
	bool remove = ((int)SvIV(ST(1))) == 0?false:true;

	int quantity =
		quest_manager.collectitems(item_id, remove);

	XSRETURN_IV(quantity);
}
let me know if i'm missing anything. I think I got it all, though..

example of how it would work in a script:

Code:
sub EVENT_SAY {
my $itemstotake = quest::collectitems(1337, 0);
my $credittostore = $qglobals{credit} ? $qglobals{credit} : 0;
if($text=~/hail/i)
{
$credittostore += $itemstotake;
quest::collectitems(1337, 1);
quest::setglobal("credit", $credittostore, 5, "F");
quest::say("Ha! I will take all those items off you now, and tell you how many I have taken, while storing it in a global that adds items to itself! All at once! Muhahaha!");
quest::say("You now have $credittostore items!");
}
}
hopefully that's not too confusing on how to use it.

the script basically takes items from your character, or counts how many you have if you specify 0 on the remove flag. pretty neat command.
have fun!
  #2  
Old 01-06-2009, 07:30 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Great piece of code, thanks Secrets!
Nice to see code submissions coming in still -

As for this;
Quote:
This is the reason that the user gave:
This person has directly stolen code from the Raid Addicts source code.. He was a paid employee of Raid Addicts and was able to get this out of our source.. Azamorra donated this source to my server and told me to not give it to anyone else DIRECTLY... * Please delete this post and warn this user.. He has been fired from my project...
If I started to feel this way about code and submissions, then I'd stop submitting code to the SVN.
I hate to think ANYONE is hoarding code, since all other people here do is give away their best in code, time and work - Personally, If I were hoarding anything EqEmu related, I would feel ashamed.
  #3  
Old 01-06-2009, 12:05 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

Quote:
Originally Posted by Angelox View Post
Great piece of code, thanks Secrets!
Nice to see code submissions coming in still -

As for this;


If I started to feel this way about code and submissions, then I'd stop submitting code to the SVN.
I hate to think ANYONE is hoarding code, since all other people here do is give away their best in code, time and work - Personally, If I were hoarding anything EqEmu related, I would feel ashamed.
To me, that quote sounds like you're saying RA applies changes to the EQEmu source and doesn't give it back to the project... which breaks the agreement set in the GPL, which this project uses...
  #4  
Old 01-06-2009, 12:48 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,447
Default

Quote:
Originally Posted by KingMort
This person has directly stolen code from the Raid Addicts source code.. He was a paid employee of Raid Addicts and was able to get this out of our source.. Azamorra donated this source to my server and told me to not give it to anyone else DIRECTLY... * Please delete this post and warn this user.. He has been fired from my project...
Yeah, about this guy...

1) How is stealing? As far as I know, you're profiting off of an opensource project, and other people who volunteer to your community.

2) You claim I am a paid employee. I did not sign any contract, I did not fill out a work permit, or any of that. I am a volunteer who you gave money to over paypal. You have no one to blame but yourself.

3) aza77 gave it to your server, however, that was a donation. It's not your code, it's not mine. I submitted it to prevent it from being lost in raid addicts code forever, it's quite useful, you know.

4) Do not delete this post, or warn this user; I have done nothing wrong by contributing code to a GPL project that was kept from it.

I have a long list of lies KingMort has said, such as, "SOE donates to my server", "Sony Developers play and test content here", etc... I could pull up a few quotes from last night too. "I am a registered government business", "I am registered with the state, and you stole from my server, all I have to do is call the Department of Justice to have you fined", etc.

I'm just saying, KingMort, you dedicate almost your entire life to this server in hopes you can profit on another companies' game, yet, you call me out and try and have me arrested because I distribute code on your server to an open-source community whose codebase you use? I find that greedy and selfish, and highly illegal in itself for various reasons.

This guy is a complete lunatic, Angelox. Pay no mind to him.
  #5  
Old 01-06-2009, 01:35 PM
Richardo
Banned
 
Join Date: Oct 2003
Location: Mattmecks Basement
Posts: 546
Default

As soon as KingMort provides me with actual evidence that Aza77 did in fact donate this bit of code ONLY for the use of KMRA. This post stays. As for your threats in the PM you sent me KingMort, you're more than welcome to file a complaint against Secrets. I am not convinced that this is legally your code and I am also not convinced you are telling the complete truth.


It's a damn shame that you can't share such a minuet useful utility to the project that has given you so much.

Last edited by Richardo; 01-06-2009 at 09:51 PM..
  #6  
Old 01-06-2009, 01:44 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,447
Default

I would also like to present further proof of stealing from a GPL Project.

http://egov.sos.state.or.us/br/pkg_w...&p_print=FALSE

He is a registered business that profits off of a GPL project.

Nice.
  #7  
Old 01-06-2009, 02:13 PM
Yeormom
Discordant
 
Join Date: Apr 2004
Location: 127.0.0.1
Posts: 402
Default

There are a lot of businesses that resell GPL software. As long as he maintains the proper rights and distributes the GPL license, it's fair use.

However, the scope of the source shared is very small and would not be difficult for any competent coder to write so it's not worth arguing once it's been released to public domain.
__________________
Yeorwned
Bane of Life [Custom Classic/PvP]
  #8  
Old 01-06-2009, 02:23 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,447
Default

Quote:
Originally Posted by Yeormom View Post
There are a lot of businesses that resell GPL software. As long as he maintains the proper rights and distributes the GPL license, it's fair use.

However, the scope of the source shared is very small and would not be difficult for any competent coder to write so it's not worth arguing once it's been released to public domain.
true. however, i've yet to see any proof that this custom work his KingMort's actual work.

also, since he is using GPL v2,
Quote:
Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
KingMort did not select a licence for his code, thus the code is public domain.
  #9  
Old 01-06-2009, 03:31 PM
Andrew80k
Dragon
 
Join Date: Feb 2007
Posts: 659
Default

I'm pretty sure the GPL version < 3 only requires the source to be "made available" only if the binaries are distributed or sold. Google does this a lot. While you use their stuff they don't actually distribute it so they are not required to make the source available. If the binaries of the RA server have ever been distributed or sold to ANYONE though, that makes them subject to the that section of the GPL and the source would be required to be made available. It's a pretty crappy thing to do too. Profit from an open source project and then not contribute anything back to it is reprehensible.
  #10  
Old 01-06-2009, 03:42 PM
Rogean's Avatar
Rogean
Administrator
 
Join Date: Jul 2003
Location: Massachusetts
Posts: 708
Default

Mort.. You're retarded.

Government Registered Business? Get the fuck outta here kid.
__________________
EQEmulator Developer / Administrator
  #11  
Old 01-06-2009, 04:01 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

I don't really know the GPL all that well, but judging by the basic idea and my personal beliefs what he is doing should be against the license and therefore what he is doing is illegal and if he is complaining and causing problems I think we should possibly try to see if what he is doing is against the GPL and I know that there should be people able to help us and make him stop committing a crime and give us the code back, since it's what the GPL should dictate him to do
  #12  
Old 01-06-2009, 04:51 PM
Kobaz
Hill Giant
 
Join Date: Nov 2008
Location: Gold Coast, Oz
Posts: 119
Default

I do know the GPL very well, and Andrew80k is spot on - if there is no distribution of the binaries there is no obligation to make the source available.

There is another issue though, in that if a commercial entity makes a profit using the commercial secrets of another entity's trade secrets, and does it by circumventing that 2nd entity's endeavours to protect its' trade secrets, and it can be shown that this was done in bad faith, then there *may* be a case for the 2nd entity to take action against the 1st entity. Attempting to make money from something that relies on SOEs property being used outside the license (unlike say alla, which doesn't require you to have EQ to use it) is bold and legally a grey area.

I would think that any attempt to claim damages for distribution of emu source would result in a claim by SOE for a share in those damages. It's what I'd do.
  #13  
Old 01-06-2009, 07:40 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

I'm not going to get into the petty drama, if Aza wants this removed he can PM me and I will other than that I'm locking this cause it's not going anywhere but flamesville.
  #14  
Old 01-06-2009, 10:51 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

EDIT: Sorry, started this post before this thread was locked, but got hung up for a few hours and didn't submit it until much after the lock. I am leaving it here anyway. If someone thinks it needs to be removed for any reason, feel free, but I don't think there is anything to spread the flames. I actually meant to post about stopping the flames too, but this post was long enough as-is, lol.

I think the point to keep in mind with all of this is that this project would be no where if it wasn't for people sharing new code that they write with the entire project. From the beginning, the emulator code has evolved by dozens of people helping and sharing with the community. In the movie "A Beautiful Mind", they mention Nash's equilibrium theorem, which says that the best possible result is for each person in a non-cooperative activity to do what is best for themselves AND the group. So, to apply that to eqemu, it means that if everyone shared their own code, it would be better for the emulator as a whole, which in turn would be better for each individual server.

By only doing what is best for your own server and keeping all code additions to yourself, you are hurting potential for your server to grow. Sure, if each server had their own special code additions, they would each benefit from a certain number of players who enjoyed those additions. If those additions were not shared, each server would lose potential for player retention that may have been added by the additions other servers have made. This means that every server would be much weaker than they would be if the code was shared by all. By making all servers weaker this way, it weakens the project as a whole because none of the servers are getting the benefits of shared code between them. And by doing that, it means that players are more likely to stop playing the emulator sooner than they may have if there were more working systems and code additions to keep them interested longer. Imagine how many players the emulator would have now if we were still running on the server code from 6 years ago. There wouldn't be much interest in the project and it probably would have died due to lack of interest long before now.

While it certainly isn't all about competition (at least for most), there is still some competition between servers. Most servers want as many players as they can get/handle. All servers should consider that by growing the community, it grows the pool of total players who play the emulator, which will then grow the potential for how many players they can possibly get on their server. IMO, the competition aspect should be done 100% in content, support, quality and attitude. Each of those are things that can give each server an individual advantage that can't easily (if at all) be shared with the rest of the community to make it better as a whole. Basically, it should be your database and service quality that define how good your server is in comparison to other servers, not the code itself.

Each code addition to public source helps the entire project and everyone can benefit from it. We have been lucky that there are many members who are following this concept even if they aren't consciously aware that they are doing it. Just to think of all of the additions that have been made over the past few months with the new SVN is pretty amazing. I am sure there is plenty of eqemu related code out there that would make a huge impact, but is being kept locked away by the servers that use it. I am sure projects like EQClassic and Shards of Delaya have an abundance of code that would be great for eqemu to have. I imagine both of those projects have benefited greatly from the open source of EQEmu, and don't consider themselves to be affiliated with EQEmu so they keep their additions private. I am not trying to point fingers anywhere or make anyone feel bad, I am just trying to use examples. Perhaps if SoD opened it's source, we could merge their code into the SVN and they would be able to receive all of the updates from SVN for their server instead of either trying to add them in manually or just ignoring them completely and missing out on tons of great new features/fixes. As far as I know, the EQClassic project has died, so any code additions they came up with are now all wasting away as far as I know, which is just, well, a waste.

As many know, I have been working on getting Secrets of Faydwer (and all previous expansions) working for the emulator. Now, I could very easily keep this to myself and have it only running on my server. Doing that may give me a few extra players who already have the expansion, or who may want to check out the new features and content enough to get a copy of it. But, a large number of the eqemu player-base wouldn't waste the time/money to get the SoF expansion just to play on one server. If I was to share the code once I get it working (and I 100% plan to), it would allow the entire emulator to upgrade to allow SoF on their own servers. This would be something that would push most of the community to get a copy of SoF to use with the emulator to gain all of the benefits from it. It could also bring more new players to the emu, because it will have moved 2 years into the future instead of being stuck with an old and limited client.

All server admins should be well aware that large number of the eqemu player-base jumps from server to server from time to time. So, by helping to increase the over-all player-base between all servers is actually helping your own server in the end. Keeping code privately to a single server may help that server get or retain more players, but it is blocking the potential for the entire project to grow it's player-base. And since many players move around from server to server before settling on a new home, the bigger the entire project player-base is, the more potential for higher player numbers on your server is. So, let's say that your server gets 5% of the over-all project player-base (making up numbers here), and something happens that increases that total number of players project-wide, then your number of players will almost certainly rise too (at least eventually). Without making forward advances, improvements and additions to the current emu code, we can't expect an over-all rise in players for the entire project. But, if people continue sharing code and making advances, the project will remain alive and active and maybe even continue to grow.

I know I probably went way more in depth than needed here, but it is something I have been wanting to mention for a while. Keeping updates to the public source privately is actually hurting anyone who does it in the long run. None of us would be here now if it wasn't for people giving back to the community what the community has given to them 100 fold already from the public source. Everyone certainly has their right to keep source changes privately, but I don't think they realize that they are doing themselves as much bad as they are good by doing so.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 01-07-2009 at 06:55 AM..
Closed Thread


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:43 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3