Go Back   The Palace Avatar Chat Community Forums. > Palace Builders Palace Users > Developers Forum

Developers Forum
Developers, Client and Server announcements.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-11-2007, 06:51 AM
Palace User
 
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 (permalink)  
Old 05-11-2007, 02:00 PM
maarten's Avatar
Palace Planet Founder
 
Join Date: Oct 2002
Location: DiGiLaNd
Posts: 1,169
Rep Power: 10
maarten is on a distinguished road
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 (permalink)  
Old 05-11-2007, 02:35 PM
Palace User
 
Join Date: Apr 2007
Posts: 11
Rep Power: 0
Macore is on a distinguished road
Thank you maarten,

Macore
Reply With Quote
  #4 (permalink)  
Old 05-11-2007, 04:55 PM
maarten's Avatar
Palace Planet Founder
 
Join Date: Oct 2002
Location: DiGiLaNd
Posts: 1,169
Rep Power: 10
maarten is on a distinguished road
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
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any clue what happened to the Plugin SDK? Mitch User Questions 2 06-23-2009 05:15 AM
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 11: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

The Latest Posts
Title, Username, & Date Last Post Forum
download
03-21-2011 11:20 AM
by maarten
User Questions
Palace for Mac OS 10.6?
03-13-2011 09:39 AM
by pawnipt
User Questions
Server
03-07-2011 04:52 PM
by satinrose
User Questions
Return room Script
02-24-2011 12:07 AM
by jaela
Room Scripts
Releasing source code
02-17-2011 09:19 AM
by Sman™
Developers Forum
Website spammers
01-26-2011 08:48 PM
by maarten
The Planet: Palace News
Online Users: 65
1 members and 64 guests
VeraFlorsewal
Most users ever online was 1,010, 06-27-2007 at 11:45 PM.
Stats
Members: 5,112
Threads: 1,141
Posts: 4,004
Top Poster: maarten (1,169)
Welcome to our newest member, cliffymayers


All times are GMT +2. The time now is 02:32 PM.


Powered by vBulletin
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0