Author |
Message |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sat Nov 01, 2003 2:04 pm Post subject: Ident problems |
 |
|
|
|
I've changed my capital ship plugin to check caps with ident instead of name, as it's just plain easier to work with.
But, for some reason, MERVBot isn't reading the ident right. So, to test it out, I made a command (!idme) that does:
sendPrivate(p, "Your ident is: " + p->ident); //Using class String '+' operator
and when I use the command, it just says "Your ident is: ".
I know MERV can read my ID, since it can send me private messages, but does anyone know what's causing this? Maybe I'm just making a stupid mistake. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Last edited by Cyan~Fire on Sat Nov 01, 2003 8:29 pm, edited 1 time in total |
|
Back to top |
|
 |
k0zy Server Help Squatter

Gender: Joined: Jan 11 2003 Posts: 571 Location: Germany Offline
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sat Nov 01, 2003 8:29 pm Post subject: |
 |
|
|
|
Oops there is not third lol, edited.
Well I made a workaround by doing if (ident), but I'd still like to know why it's doing this |
|
Back to top |
|
 |
ExplodyThingy Server Help Squatter
Age:38 Gender: Joined: Dec 15 2002 Posts: 528 Location: Washington DC Offline
|
Posted: Sat Nov 01, 2003 8:39 pm Post subject: |
 |
|
|
|
p->ident is NOT good to use. Ident is not ?userid. Its the 3-byte id assigned by the server for use with chat and such items. It changes from connection to connection. _________________ There are no stupid question, but there are many inquisitive idiots.
Loot
Dr Brain> I hate clean air and clean water. I'm a member of Evil Conservitive Industries |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:41 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Sat Nov 01, 2003 10:57 pm Post subject: |
 |
|
|
|
ExplodyThingy wrote: | Its the 3-byte id assigned by the server for use with chat and such items. It changes from connection to connection. |
2 bytes. Just in the one position packet's case, it uses one byte, so it can shrink the packet's size. If the userid is over 255, it will always use the larger position packet. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sat Nov 01, 2003 11:01 pm Post subject: |
 |
|
|
|
Oh. So you recommend I switch back to p->name? |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Sat Nov 01, 2003 11:36 pm Post subject: |
 |
|
|
|
ident starts at 0 and increments up for each player.
So if the bot was in the arena, it would be ident=0 then I entered then i would be Ident=1. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sun Nov 02, 2003 1:12 pm Post subject: |
 |
|
|
|
Except it was just not getting an ident for players. The if (p->ident == blah) statement was true for every single player...
I'll just switch back to names, I guess. |
|
Back to top |
|
 |
VampZ Guest
Offline
|
Posted: Sun Nov 02, 2003 7:18 pm Post subject: |
 |
|
|
|
try casting it to a string before you print it
sendPrivate(p,"your ident is " + (String)p->ident); |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sun Nov 02, 2003 9:24 pm Post subject: |
 |
|
|
|
No, the String class has its own operator for adding integers.
Anyway, I already switched back to p->name, so topic closed. But, thanks anyway.  |
|
Back to top |
|
 |
VampZ Guest
Offline
|
Posted: Wed Nov 19, 2003 12:10 pm Post subject: |
 |
|
|
|
it doesn't convert it to a String because you're adding a const char* and an integer, and then trying to convert the result to a String... if it did work you would have gotten a number... and clearly you didn't  |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Wed Nov 19, 2003 4:12 pm Post subject: |
 |
|
|
|
Other things I have tried worked like this... or at least I think so.
Thanks, but lol I've totally redone my system now to use Player struct pointers, instead of just one value. Makes a lot more sense. |
|
Back to top |
|
 |
|