Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Ident problems

 
Post new topic   Reply to topic Printable version
 View previous topic  MVC++ 7.0 and MYSQL Post :: Post Mervbot time control?  View next topic  
Author Message
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sat Nov 01, 2003 2:04 pm    Post subject: Ident problems Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Sat Nov 01, 2003 7:03 pm    Post subject: Reply to topic Reply with quote

Code: Show/Hide
sendPrivate(p, "Your ident is: " + p->ident");


Where does the third " come from?
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sat Nov 01, 2003 8:29 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
ExplodyThingy
Server Help Squatter


Age:38
Gender:Gender:Male
Joined: Dec 15 2002
Posts: 528
Location: Washington DC
Offline

PostPosted: Sat Nov 01, 2003 8:39 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:41
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Sat Nov 01, 2003 10:57 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sat Nov 01, 2003 11:01 pm    Post subject: Reply to topic Reply with quote

Oh. So you recommend I switch back to p->name?
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Sat Nov 01, 2003 11:36 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email AIM Address
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Nov 02, 2003 1:12 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
VampZ
Guest


Offline

PostPosted: Sun Nov 02, 2003 7:18 pm    Post subject: Reply to topic Reply with quote

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!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Nov 02, 2003 9:24 pm    Post subject: Reply to topic Reply with quote

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. icon_smile.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
VampZ
Guest


Offline

PostPosted: Wed Nov 19, 2003 12:10 pm    Post subject: Reply to topic Reply with quote

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 icon_smile.gif
Back to top
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Wed Nov 19, 2003 4:12 pm    Post subject: Reply to topic Reply with quote

Other things I have tried worked like this... or at least I think so. icon_razz.gif

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
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 98 page(s) served in previous 5 minutes.

phpBB Created this page in 0.502513 seconds : 37 queries executed (94.1%): GZIP compression disabled