Page 1 of 1

Need a function that will return server ID number

Posted: Tue Apr 29, 2003 1:32 pm
by Mckorr
Don't see this in the current source code, maybe someone can help me.

I need a function/whatever that gives me the current server number. So if the current (active) character is on Prexus, the function should give me a value of 32.

I don't need a command (/whichserver), I just need the numeric ID of the current active server.

Thanks.

Posted: Tue Apr 29, 2003 5:51 pm
by dont_know_at_all
Why?

I don't think that data is easily available.

Posted: Tue Apr 29, 2003 6:14 pm
by fwiggles
couldn't it be read from the character UI file? don't they go somethihng like UI_Fwiggles_12.ini it seems like you could maybe do somethin that would detect the char name, find the UI file and then take out the number...but hell i don't know anything...

Posted: Wed Apr 30, 2003 8:23 am
by Mckorr
Doesn't work that way fwiggles:

You can have characters with the same name on different servers. INI files for that character take the form of Name_##.ini and UI_Name_##.ini, where ## is the server ID number. So if I have Mckorr on server 23 AND on 32, I will have Mckorr_23.ini and Mckorr_32.ini in my EQ directory.

So, I need to figure out which of those files to use to continue my work on fixing /click. The UI_Name_##.ini file is needed for ParseMouseLoc.

The information must be available someplace, or EQ wouldn't know which UI_Name_##.ini file to update when it updates/saves characters. I suppose you could check the date/time of last access and use the most recent, but that sounds like a major headache.

We have a few unknowns in the struct for _CHARINFO, could one of those be the server ID?

Posted: Wed Apr 30, 2003 8:29 am
by eqjoe
Its not like you are gonna see zone spawns on different servers. I dont think server ID is in there.


I will bet its in momory somewhere.... after the patch I will take a look if our stucts dont get FUBR'd.

there is an offset for it...

Posted: Wed Apr 30, 2003 10:05 am
by EqMule
I have seen the current used UI logfile many times when working with the structures, I could probably find the offset and you can just readprocessmemory to read the string to a variable... I will check and get back to you, or you can just search for it in Winhack and then search eqgame.exe for the address you land on...

l8er

Posted: Wed Apr 30, 2003 6:02 pm
by fwiggles
hmm...i dunno then. I didn't even know you could have the same charname for each server.

Posted: Thu May 01, 2003 12:33 am
by Geeknik
I think it might be nice to find the ini file without the need of an offset that could change. I think the last "Accessed" file attribute is NT specific (?) so, another thought, does EQ put any kind of detectable lock on the ini file that it's using (like it does with the logfile) ? Dunno, just a couple thoughts

Posted: Thu May 01, 2003 5:34 am
by Valerian
it puts a detectable lock on the logfile? get the server number from that filename! :roll:

edit: doh.... unless of course logging isn't enabled... I should think before posting :oops: