Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

A new command /mw aka Multiple Whisper

Skilled Illusionist
Joined
Apr 22, 2009
Messages
301
Reaction score
19
Hello guys, today I've been coding a new command wich allow you to whisper multiple user, usage will be :

-1. create a user list:
/user_list create my_list

-2. add some users to the list:
/user_list add user
or
/user_list add user user1 etc...

-3. whisper a message to them with :
/mw my_list my message

So far I have coded every command, all I need is do the debugging and testing before I release it and it's source.
 

Joined
Dec 22, 2007
Messages
680
Reaction score
430
What's the advantages of this against the chatroom feature already on GunZ? Only factor I see good about this is the ability to add people in the mw list without their consent.
 
Skilled Illusionist
Joined
Apr 22, 2009
Messages
301
Reaction score
19
Because using chatrooms, anyone in the chatroom can : Join / See who is inside / Read

This command has a different usage, when you want to send a whisper to multiple users, but not more, I guess it could be used as a chat too.
 
Skilled Illusionist
Joined
Nov 11, 2008
Messages
388
Reaction score
42
Kinda useless.

Not at all. If he releases it it will give people an idea of how whispering is structured, and what's more is you can learn from it. I don't see many topics of this kind.

@Paul, great job and good luck with further progress.
 
Skilled Illusionist
Joined
Apr 22, 2009
Messages
301
Reaction score
19
It's so easy to recruit people around and clan hop, by the way the main goal of this is to show how to implement a quite complex command, so stop the QQ - I don't care about that - you'd better wait for me to release the code, I still have a few thing to debug.
 
What year is this?
Joined
Nov 12, 2008
Messages
867
Reaction score
141
isnt /chatmake, /chatinvite, /chatjoin the same function?
You add ppl that allowed to read and answer to you, other ppl cant see this chat? o_O
 
Newbie Spellweaver
Joined
Jun 16, 2009
Messages
53
Reaction score
34
This isn't as complex as he makes it sound.

1. Hook ZChatInput.
2. In your ZChatInput detour, hook the necessary commands (/mw add and /mw remove, you say?)
3. Have an std::list of player names maintained.
4. Whenever someone types /mw [message], just iterate through the list and call ZPostWhisper with each one as the second parameter.

The hardest part in this is the text parsing, and I've already got a whole framework set up for that which wasn't too difficult to make. I'll share some of the code if you're looking for ideas.
 
Skilled Illusionist
Joined
Apr 22, 2009
Messages
301
Reaction score
19
This isn't as complex as he makes it sound.

1. Hook ZChatInput.
2. In your ZChatInput detour, hook the necessary commands (/mw add and /mw remove, you say?)
3. Have an std::list of player names maintained.
4. Whenever someone types /mw [message], just iterate through the list and call ZPostWhisper with each one as the second parameter.

The hardest part in this is the text parsing, and I've already got a whole framework set up for that which wasn't too difficult to make. I'll share some of the code if you're looking for ideas.

I have not said it was difficult, i've already done the whose text parsing part.

So far you can look at the code here :

It's complete enough for any one to see how you could implement commands with multiple parameters.
 
What year is this?
Joined
Nov 12, 2008
Messages
867
Reaction score
141
I have not said it was difficult, i've already done the whose text parsing part.

So far you can look at the code here :

It's complete enough for any one to see how you could implement commands with multiple parameters.

You didnt answer my question tho..
I want to know diffrence between /chat and your command >_>
 
Newbie Spellweaver
Joined
Jun 16, 2009
Messages
53
Reaction score
34
I have not said it was difficult, i've already done the whose text parsing part.

So far you can look at the code here :

It's complete enough for any one to see how you could implement commands with multiple parameters.

Why are you using the C string comparison function on C++ strings? You're doingitwrong.

Use ==.

Also, why'd you roll your own functions for a vector? For example, in user_list.h, you basically wrote your own vector<_T>::find function. Every one of the functions you made in user_list has already been done for you by the STL.
 
Last edited:
Skilled Illusionist
Joined
Apr 22, 2009
Messages
301
Reaction score
19
Why are you using the C string comparison function on C++ strings? You're doingitwrong.

Use ==.

Also, why'd you roll your own functions for a vector? For example, in user_list.h, you basically wrote your own vector<_T>::find function. Every one of the functions you made in user_list has already been done for you by the STL.

Actually for string comparison, you are right, but I actually just updated my old code, and did not bother to change it, as for the structures, I wrote them because it was faster then writing a whole class (wich I should do).
 
Praise the Sun!
Loyal Member
Joined
Dec 4, 2007
Messages
2,502
Reaction score
986
I've seen that code before I believe.

And, yet again, use strncmp() instead of exploding the string and then doing memcmp(). memcmp() isn't made to compare strings.

 
Skilled Illusionist
Joined
Apr 22, 2009
Messages
301
Reaction score
19
I've seen that code before I believe.

And, yet again, use strncmp() instead of exploding the string and then doing memcmp(). memcmp() isn't made to compare strings.


This evening, I'll clean all that code, and yes you saw it previously, because it just is another nickname.
 
Back
Top