Go Back   The Palace Avatar Chat Community Forums. > Palace Builders Palace Users > Developers Forum
Register FAQ Members List Calendar Arcade Toplist Search Today's Posts Mark Forums Read

Developers Forum
Developers, Client and Server announcements.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-11-2007, 05:51 AM
Macore Macore is offline
member
 

Join Date: Apr 2007
Posts: 11
Rep Power: 0
Macore is on a distinguished road
Palace Plugin - Cant examine or consume USERMOVE message

OK,

I donwloaded the Server_SDK.ZIP for Palace and complied and ran the example plugin perfectly.

I want to make a plugin that can selectively prevent a user from moving around in a room, sort of like the `PIN command, but freezing them at their current location and not changing their avatar.

As a test I tried to examine the MSG_USERMOVE message and consume it with my plugin. Thinking this would prevent ALL users from moving. This crashes my Palace server. If I comment out the examination code, the server runs but people can still move as if I have not consumed the message...

Anybody can help would be appreciated... Code for message handler pasted in below:

ClientMsg *handleMessage(ServerState *state, AnyType pluginDat, ClientMsg *msg)
{
char buf[256];
char *text;
int textLength;

/* talk messages */
if (msg->eventType == MSG_TALK || msg->eventType == MSG_XTALK)
{
ClientMsg_xTalk *xmsg = (ClientMsg_xTalk *) &msg->msg;
if (msg->eventType == MSG_TALK)
{
/* Normal talk messages just have plain text... */
ClientMsg_talk *tmsg = (ClientMsg_talk *) &msg->msg;
text = tmsg->text;
}
else
{
/* ...but xtalk messages need to be "decrypted". */
if (msg->length < sizeof(uint16))
{
/* Abort if badly formed xstring */
return msg;
}

textLength = *(uint16 *)(xmsg->text) - 3;
if (textLength > 255)
{
/* Avoid nasty buffer overrun opportunity */
return msg;
}
DecryptCString((StringPtr) xmsg->text + 2, buf, textLength, FALSE);
text = buf;
}

/* Handle commands, if present */
if (checkCommands((PluginID) pluginDat, text, state->currentUser))
{
/* Consume commands */
return NULL;
}
return msg;
}

char smBuff[32];
sprintf(smBuff, "Message: %08x", msg->eventType);
UserPrivateMessage(state->currentUser, smBuff);

if (msg->eventType == MSG_USERMOVE)
{
Point *pt = (Point *) msg->msg;

char medBuff[64];
sprintf(medBuff, "New Pos: v=%d, h=%d", (int) pt->v, (int) pt->h);
UserPrivateMessage(state->currentUser, medBuff);

/* Consume commands */
return NULL;
}
return msg;
}


Thanks,
Macore
Reply With Quote
  #2  
Old 05-11-2007, 01:00 PM
maarten's Avatar
maarten maarten is online now
forum die hard
 
Join Date: Oct 2002
Location: DiGiLaNd
Posts: 975
Rep Power: 10
maarten is on a distinguished road
Send a message via ICQ to maarten Send a message via AIM to maarten Send a message via Yahoo to maarten
Not sure anyone on the forum would know how to answer this, perhaps try posting your question on the Palace Server group? We got some of the original Palace programmers on there.

http://tech.groups.yahoo.com/group/palace-server/
Reply With Quote
  #3  
Old 05-11-2007, 01:35 PM
Macore Macore is offline
member
 

Join Date: Apr 2007
Posts: 11
Rep Power: 0
Macore is on a distinguished road
Thank you maarten,

Macore
Reply With Quote
  #4  
Old 05-11-2007, 03:55 PM
maarten's Avatar
maarten maarten is online now
forum die hard
 
Join Date: Oct 2002
Location: DiGiLaNd
Posts: 975
Rep Power: 10
maarten is on a distinguished road
Send a message via ICQ to maarten Send a message via AIM to maarten Send a message via Yahoo to maarten
No prob and yes its a free service (the yahoo group) helping people on Palace should always be free i think. :)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
wordfilter plugin dustinn User Questions 2 12-15-2006 04:59 AM
start-plugin will not work, but start-palace will RobertSearcy User Questions 1 04-12-2005 10:11 AM
Weird message entering palace? complexity User Questions 1 02-03-2005 08:56 PM
Wordfilter plugin Riverspirit User Questions 4 01-19-2005 03:15 PM
Any clue what happened to the Plugin SDK? Mitch User Questions 1 10-12-2004 10:34 AM


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.