HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Making threads to link to banned members content grants an automatic ban
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 The E problem (solved)

View previous topic View next topic Go down 
AuthorMessage
Wolfheart202

avatar

Game username : Snack/WolfHeart
Server : Aoi Tenshi (Co-Owner)
Female Posts : 25
Join date : 2013-10-04
Age : 16
Location : Unknown

PostSubject: The E problem (solved)   Tue Aug 08, 2017 1:43 pm

Heey
Because god speak wasn't really effective to announcing in-game stuff (some people don't really look at the chat all the time) I wanted to make an alert box that shows up.
It does work but everytime it shows up there is always an "e" at the beginning. I don't know if I'm just blind but I can't find where it comes from. x-x

It works similar then the god speak.



Here is the code, where the game creates the message:

Code:
 void MagixNetworkManager::processGodMessage(Packet *p)
{
 RakNet::BitStream tBitStream(p->data, p->length, false);
 MessageID tID;
 char tCaption[512];

 tBitStream.Read(tID);
 stringCompressor->DecodeString(tCaption, 512, &tBitStream);
 
 mChatManager->message(tCaption);
}
void MagixNetworkManager::sendGodMessage(const String &caption)
{
 const String tCaption = caption;
 mChatManager->message(tCaption);
 mAlertBox->showAlert(tCaption, 0.5, 0.5, 10);

 RakNet::BitStream tBitStream;

 tBitStream.Write(MessageID(ID_GODMESSAGE));
 stringCompressor->EncodeString(tCaption.c_str(), 512, &tBitStream);

 mPeer->Send(&tBitStream, MEDIUM_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true);
}  

If you need more code, tell me ^^
I would be very pleased if someone could help me. c:


Last edited by Wolfheart202 on Thu Aug 10, 2017 7:52 am; edited 1 time in total
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 471
Join date : 2014-02-09
Age : 19

PostSubject: Re: The E problem (solved)   Wed Aug 09, 2017 4:29 am

did you change the command itself? like, is it still "/godspeak" or did you change that?

________________________________
i can code you things
Back to top Go down
http://azoptaos.boards.net/
Wolfheart202

avatar

Game username : Snack/WolfHeart
Server : Aoi Tenshi (Co-Owner)
Female Posts : 25
Join date : 2013-10-04
Age : 16
Location : Unknown

PostSubject: Re: The E problem (solved)   Wed Aug 09, 2017 10:04 am

Yes I made an entirely new command for that.

Here are the codes:

Code:
  #define COMMAND_GODMESSAGE "/godmessage " 

Code:
  mChatManager->message("/godmessage [message]"); 
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 471
Join date : 2014-02-09
Age : 19

PostSubject: Re: The E problem (solved)   Wed Aug 09, 2017 11:46 pm

ah, yeah. so in MagixChatManager.cpp, if you copied the godspeak codes, you should have something like this:

Code:
//godmessage
 if (StringUtil::startsWith(caption, COMMAND_GODMESSAGE))
 {
 caption.erase(0, 10);
 type = CHAT_COMMAND;
 param = COMMAND_GODMESSAGE;
 return;
 }

you need to modify the caption.erase(0, 10);

it should be caption.erase(0, 12);

basically, that line erases the actual command you type in the chat so it doesn't show up in whatever you type. you have the "e_" showing up because you're not erasing the entire command

________________________________
i can code you things
Back to top Go down
http://azoptaos.boards.net/
Wolfheart202

avatar

Game username : Snack/WolfHeart
Server : Aoi Tenshi (Co-Owner)
Female Posts : 25
Join date : 2013-10-04
Age : 16
Location : Unknown

PostSubject: Re: The E problem (solved)   Thu Aug 10, 2017 7:51 am

Thanks very much, that was the problem! x3
Back to top Go down
 
The E problem (solved)
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: SUPPORT :: Support :: Solved Support Issues-
Jump to: