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

Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2009, 02:07 PM
realityincarnate
Developer
 
Join Date: Dec 2007
Posts: 122
Default Title suffix quest command [Committed in Rev420]

There was a thread not too long ago talking about using quest commands to add titles. There didn't seem to be any way to access the suffix part through the perl scripting, so I added one.

Syntax: $client->SetTitleSuffix(title)

Code:
Index: zone/perl_client.cpp
===================================================================
--- zone/perl_client.cpp	(revision 403)
+++ zone/perl_client.cpp	(working copy)
@@ -3524,6 +3524,32 @@
 	XSRETURN_EMPTY;
 }
 
+XS(XS_Client_SetTitleSuffix);
+XS(XS_Client_SetTitleSuffix) {
+	dXSARGS;
+	if (items != 2)
+		Perl_croak(aTHX_ "Usage: Client::SetTitleSuffix(THIS, txt)");
+	{
+		Client *		THIS;
+		char *		txt = (char *)SvPV_nolen(ST(1));
+
+		if (sv_derived_from(ST(0), "Client")) {
+			IV tmp = SvIV((SV*)SvRV(ST(0)));
+			THIS = INT2PTR(Client *,tmp);
+		}
+		else
+			Perl_croak(aTHX_ "THIS is not of type Client");
+		if(THIS == NULL)
+			Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");
+
+		if(strlen(txt) > 31) 
+			Perl_croak(aTHX_ "Title must be 31 characters or less");
+
+		THIS->SetTitleSuffix(txt);
+	}
+	XSRETURN_EMPTY;
+}
+
 #ifdef __cplusplus
 extern "C"
 #endif
@@ -3675,6 +3701,7 @@
 		newXSproto(strcpy(buf, "SendZoneFlagInfo"), XS_Client_SendZoneFlagInfo, file, "$$");
 		newXSproto(strcpy(buf, "LoadZoneFlags"), XS_Client_LoadZoneFlags, file, "$");
 		newXSproto(strcpy(buf, "SetAATitle"), XS_Client_SetAATitle, file, "$$");
+		newXSproto(strcpy(buf, "SetTitleSuffix"), XS_Client_SetTitleSuffix, file, "$$");
 	XSRETURN_YES;
 }

Last edited by Derision; 04-10-2009 at 09:13 PM.. Reason: [Committed in Rev420]
Reply With Quote
  #2  
Old 04-04-2009, 07:01 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Thanks! I am sure people will appreciate that. Would be nice to get one added for prefixes too, as I don't think we have one to handle those yet either.

I have looked through the packet for sending titles to the client so they can be used in the Titles window like normal. It doesn't seem like it would be hard at all to code that to work properly. Maybe at some point, I can try to get that going after the SoF work is all done
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
Reply


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 06:10 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