Need a function that will return server ID number

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Need a function that will return server ID number

Post by Mckorr » Tue Apr 29, 2003 1:32 pm

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.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Tue Apr 29, 2003 5:51 pm

Why?

I don't think that data is easily available.

fwiggles
a hill giant
a hill giant
Posts: 161
Joined: Mon Jun 17, 2002 8:29 pm

Post by fwiggles » Tue Apr 29, 2003 6:14 pm

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...
[color=red]Latest survey shows that 3 out of 4 people make up 75% of the world's population.[/color]

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Wed Apr 30, 2003 8:23 am

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?

eqjoe
a grimling bloodguard
a grimling bloodguard
Posts: 984
Joined: Sat Sep 28, 2002 12:26 pm

Post by eqjoe » Wed Apr 30, 2003 8:29 am

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.

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

there is an offset for it...

Post by EqMule » Wed Apr 30, 2003 10:05 am

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
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

fwiggles
a hill giant
a hill giant
Posts: 161
Joined: Mon Jun 17, 2002 8:29 pm

Post by fwiggles » Wed Apr 30, 2003 6:02 pm

hmm...i dunno then. I didn't even know you could have the same charname for each server.
[color=red]Latest survey shows that 3 out of 4 people make up 75% of the world's population.[/color]

Geeknik
decaying skeleton
decaying skeleton
Posts: 2
Joined: Wed Apr 30, 2003 10:41 pm
Location: Home.. wait, this isn't my home?

Post by Geeknik » Thu May 01, 2003 12:33 am

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

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Thu May 01, 2003 5:34 am

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: