Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 03-04-2002, 07:48 PM
lacidar
Fire Beetle
 
Join Date: Feb 2002
Posts: 8
Default Socials and emotes code review

Here's my take on socials and emotes.

ep_opcodes.h
Code:
// Socials
#define OP_Social_Text		0x1520
#define OP_Social_Action	0xa120
eq_packet_structs.h
Code:
//OP_Social_Text
struct Emote_Text {
	int16 unknown1;
	char message[1024];
};

//OP_Social_Action
struct Social_Action_Struct {
	int8 unknown1[4];
	int8 action;
	int8 unknown2[7];
};
client_process.cpp
Code:
case OP_Social_Text: {
                cout << "Social Text: " << app->size << endl;		//DumpPacket(app);
	APPLAYER *outapp = new APPLAYER;
	outapp->opcode = app->opcode;
	outapp->size = sizeof(Emote_Text);
	outapp->pBuffer = new uchar[outapp->size];
	outapp->pBuffer[0] = app->pBuffer[0];
	outapp->pBuffer[1] = app->pBuffer[1];
	uchar *cptr = outapp->pBuffer + 2;
	cptr += sprintf((char *)cptr, "%s", GetName());
	cptr += sprintf((char *)cptr, "%s", app->pBuffer + 2);
	cout << "Check target" << endl;
	if(target != NULL && target->IsClient())
	{
		cout << "Client targeted" << endl;
		entity_list.QueueCloseClients(this, outapp, true, 100, target);
		//cptr += sprintf((char *)cptr, " Special message for you, the target");
		cptr = outapp->pBuffer + 2;

                                // not sure if live does this or not.  thought it was a nice feature, but would take a lot to clean up grammatical and other errors.  Maybe with a regex parser...
/*
		replacestr((char *)cptr, target->GetName(), "you");
		replacestr((char *)cptr, " he", " you");
		replacestr((char *)cptr, " she", " you");
		replacestr((char *)cptr, " him", " you");
		replacestr((char *)cptr, " her", " you");
*/
		entity_list.GetMob(target->GetName())->CastToClient()->QueuePacket(outapp);
	}
	else
                	entity_list.QueueCloseClients(this, outapp, true, 100);
	delete outapp;
	break;
}
case OP_Social_Action: {
	cout << "Social Action:  " << app->size << endl;
	//DumpPacket(app);
	entity_list.QueueCloseClients(this, app, true);
	break;
}
Reply With Quote
  #2  
Old 03-05-2002, 03:02 PM
DeletedUser
Fire Beetle
 
Join Date: Sep 2002
Posts: 0
Default

I just added your code into the main brance. It will be in the next pre-release (4). Thanks
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 02:28 AM.


 

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