Jump to content
  • 0

@main command


x13th

Question


  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  11/20/11
  • Last Seen:  

is it possible if i use @main command and have a message with column symbol " : " it will not send but you will receive a message saying " Not allowed using special characters "

Example:

Player 1 use @main

@main HELLO WORLDDD :(

the @main message will not be send rather the one using @main will receive a message.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  967
  • Reputation:   53
  • Joined:  11/13/11
  • Last Seen:  

Hi x13th

for @main to work

the Receiver must open @main

via @main on

now the receiver's @main is on

you gm = check if @main is on too

then to send message to all people whom @main is on

is [Main] : [<Message>]

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  11/20/11
  • Last Seen:  

you don't get it.

if people use @main they are going to type a message ,right? so if they type a message with column symbol the message will not be send rather they will get dispbotton message saying not allowed special char

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  967
  • Reputation:   53
  • Joined:  11/13/11
  • Last Seen:  

hi

i will try to reproduce your situation~

gimme 3mins~

post-296-0-16450200-1325048563_thumb.jpg

post-296-0-49433400-1325048566_thumb.jpg

Edited by KeiKun
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   47
  • Joined:  11/18/11
  • Last Seen:  

I think he meant to just restrict special characters when using @main so it wouldn't give you gravity error (with a custom line [386] msg_athena.conf) when the message is larger than 24 characters.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  967
  • Reputation:   53
  • Joined:  11/13/11
  • Last Seen:  

I think he meant to just restrict special characters when using @main so it wouldn't give you gravity error (with a custom line [386] msg_athena.conf) when the message is larger than 24 characters.

actually even having 24character+++ it doesn't give errors with @main

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

i think he is requesting for some modification for the @main command that restrict certain special character that occur in string...

For Example :

Current Command ( included / extra 1 column symbol in message

@main  Main: blabla : haha 

it work currently...

After Modified

@main  Main: blabla : haha 

will not work anymore...because of the existance of the Colum Symbol in the message....

well...just a noob scracthing...( perhaps it wont works )

if( strcmpi( message ,":" ) ) return 0;

check for the column symbol before announce the @main message...

if the condition is true..then dispbottom a message for unable to use special character in mesage..

Edited by Emistry
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  11/20/11
  • Last Seen:  

I think he meant to just restrict special characters when using @main so it wouldn't give you gravity error (with a custom line [386] msg_athena.conf) when the message is larger than 24 characters.

yes. i'm asking for this one >.<

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  967
  • Reputation:   53
  • Joined:  11/13/11
  • Last Seen:  

I think he meant to just restrict special characters when using @main so it wouldn't give you gravity error (with a custom line [386] msg_athena.conf) when the message is larger than 24 characters.

yes. i'm asking for this one >.<

way too different @ post #1

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

is it possible if i use @main command and have a message with column symbol " : " it will not send but you will receive a message saying " Not allowed using special characters "

you guys misinterprete his posts.....:(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

Try to convert it to integer Iam not sure on what I remember I just read it on C for Dummies :( I remember that when you parse a character value to integer it gives you its ASCII code...

int myvar = int(characterVar);

Well I guess you need to Iterate to the char variable to make this work

ASCII table reference:

http://web.cs.mun.ca...scii-table.html

Edited by JayPeeMateo
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  11/20/11
  • Last Seen:  

How to modify the source code? </3

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   47
  • Joined:  11/18/11
  • Last Seen:  

is it possible if i use @main command and have a message with column symbol " : " it will not send but you will receive a message saying " Not allowed using special characters "

you guys misinterprete his posts..... :(

I think he meant to just restrict special characters when using @main so it wouldn't give you gravity error (with a custom line [386] msg_athena.conf) when the message is larger than 24 characters.

yes. i'm asking for this one >.<

How so?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  57
  • Reputation:   15
  • Joined:  12/25/11
  • Last Seen:  

src/map/atcommand.c

In the function ACMD_FUNC(main)

search for:

 } else {
  if(!sd->state.mainchat) {
sd->state.mainchat = 1;
clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
  }
  if (sd->sc.data[sC_NOCHAT] && sd->sc.data[sC_NOCHAT]->val1&MANNER_NOCHAT) {
clif_displaymessage(fd, msg_txt(387));
return -1;
  }
  sprintf(atcmd_output, msg_txt(386), sd->status.name, message);
  // I use 0xFE000000 color for signalizing that this message is
  // main chat message. 0xFE000000 is invalid color, same using
  // 0xFF000000 for simple (not colored) GM messages. [LuzZza]
  intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, 0xFE000000, 0, 0, 0, 0);
  // Chat logging type 'M' / Main Chat
  log_chat(LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message);
 }

and replace it with the following:

 } else {
  if(!strstr(message, ":")) {
  if(!sd->state.mainchat) {
sd->state.mainchat = 1;
clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated.
  }
  if (sd->sc.data[sC_NOCHAT] && sd->sc.data[sC_NOCHAT]->val1&MANNER_NOCHAT) {
clif_displaymessage(fd, msg_txt(387));
return -1;
  }
  sprintf(atcmd_output, msg_txt(386), sd->status.name, message);
  // I use 0xFE000000 color for signalizing that this message is
  // main chat message. 0xFE000000 is invalid color, same using
  // 0xFF000000 for simple (not colored) GM messages. [LuzZza]
  intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, 0xFE000000, 0, 0, 0, 0);
  // Chat logging type 'M' / Main Chat
  log_chat(LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message);
 } else {
  clif_displaymessage(fd, "Invalid characters");
  }

 }

This will result in ignoring all messages containing ":" and displaying "Invalid characters" as a dispbottom instead.

Edited by Realusion
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  11/20/11
  • Last Seen:  

src/map/atcommand.c In the function ACMD_FUNC(main) search for:
 } else { if(!sd->state.mainchat) { sd->state.mainchat = 1; clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated. } if (sd->sc.data[sC_NOCHAT] && sd->sc.data[sC_NOCHAT]->val1&MANNER_NOCHAT) { clif_displaymessage(fd, msg_txt(387)); return -1; } sprintf(atcmd_output, msg_txt(386), sd->status.name, message); // I use 0xFE000000 color for signalizing that this message is // main chat message. 0xFE000000 is invalid color, same using // 0xFF000000 for simple (not colored) GM messages. [LuzZza] intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, 0xFE000000, 0, 0, 0, 0); // Chat logging type 'M' / Main Chat log_chat(LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message); } 

and replace it with the following:

 } else { if(!strstr(message, ":")) { if(!sd->state.mainchat) { sd->state.mainchat = 1; clif_displaymessage(fd, msg_txt(380)); // Main chat has been activated. } if (sd->sc.data[sC_NOCHAT] && sd->sc.data[sC_NOCHAT]->val1&MANNER_NOCHAT) { clif_displaymessage(fd, msg_txt(387)); return -1; } sprintf(atcmd_output, msg_txt(386), sd->status.name, message); // I use 0xFE000000 color for signalizing that this message is // main chat message. 0xFE000000 is invalid color, same using // 0xFF000000 for simple (not colored) GM messages. [LuzZza] intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, 0xFE000000, 0, 0, 0, 0); // Chat logging type 'M' / Main Chat log_chat(LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message); } else { clif_displaymessage(fd, "Invalid characters"); } } 

This will result in ignoring all messages containing ":" and displaying "Invalid characters" as a dispbottom instead.

Thank you so much <3

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...