View Full Version : CLI for probing turn status
WraithLord
October 23rd, 2006, 05:45 PM
Hi,
Does someone know if there is a CLI option to probe a DOM-III tcp server turn status?- I really miss the "gods-eye" utility for dom-II and until there is (hopefully) one for dom-III this command (if exists) will be very handy.
I have multiple computers and every now and again when I check the turn status I get my turn wiped out (when a blank turn is uploaded instead of a full one).
TIA
MarcinM
October 23rd, 2006, 05:50 PM
I would like to know this too. What I'm using in the meantime is writing the events out to a logfile, then reading it and parsing it for info.
I also add player names, but of course that all takes manual setup upfront. Let me know if you want the script though (and happen to be running PHP on your server http://forum.shrapnelgames.com/images/smilies/wink.gif.
WraithLord
October 23rd, 2006, 06:58 PM
Can this script run from the client side?
I'm afraid I didn't quite get the part about events, what events are those exactly?
Gandalf Parker
October 24th, 2006, 10:59 AM
If you have logging turned on and going to a file then doing a "tail" of that log shows this....
Fast2, Connections 1, Time 21h (quick host)
Er- Ul- Ti- Mi- Ct- *Yom-
That says no one has done the turn (the - changes to a + when a turn is turned in) and it shows that Yom is connected.
There is alot of info there. Just a CGI to tail -1 of the log shouldnt be hard. Parsing that into an html wouldnt be too difficult either. Adding abit of scripting to change it into something more readable might even be fun.
Adding icons for all of the nation flags and turning them into flags with an X on it, adding the chain links for a connection, etc so that it looks like people see at their end would be possible.
Adding a countdown clock till the next hosting, adding clouds or frowny faces to the ones that are close to getting a stale turn, all of that would be possible. Insane, but possible.
WraithLord
October 24th, 2006, 11:43 AM
Thanks Gandalf, your suggestion sounds simple to do, but it requires adding things (CGI for example) and not supported off the shelf so to speak.
I wonder how did the god's eye client work, I could have figured this out had I had access to its source code (I would guess its Java). Or maybe I can ask the its author, does anyone recall whom might he be?
Gandalf Parker
October 24th, 2006, 12:02 PM
Sorry. I tend to think of hosting as a linux server (CGI isnt something you add, its part of web pages)
If you let me know the OS I can answer more exactly. Are you wanting something you can click on in windows that checks the host without having to load Dominions?
Arralen
October 24th, 2006, 12:53 PM
WraithLord said:
I wonder how did the god's eye client work, I could have figured this out had I had access to its source code (I would guess its Java). Or maybe I can ask the its author, does anyone recall whom might he be?
IIRC, it's written in Eiffel and Illwinter disclosed part of the client/server protocol. Search the Dom2 forum for more info ... .. or look here ... (http://www.fams.de/download.html)
http://www.shrapnelcommunity.com/threads/uploads/462249-goodseye.png
MarcinM
October 24th, 2006, 12:59 PM
Yep, that's what I'm doing (http://froggyfish.net/squidz/), works pretty well. As was said however, it does require scripting and hosting on the client side.
You could write that logfile out and just put it in a publicly accessible webdir as a very crude method of getting feedback with no scripting.
WraithLord
October 24th, 2006, 01:42 PM
Gandalf Parker said:
Sorry. I tend to think of hosting as a linux server (CGI isnt something you add, its part of web pages)
If you let me know the OS I can answer more exactly. Are you wanting something you can click on in windows that checks the host without having to load Dominions?
I can add CGI if I'm the web page admin http://forum.shrapnelgames.com/images/smilies/wink.gif
Assuming my OS os windows, I want what you said: something the checks the host w/o loading dominions.
Is that feasible? (God's eye suggest the answer is yes).
Had I know the details of the protocol I could have done this manually with telnet, or write a smallish script that does the same automatically.
WraithLord
October 24th, 2006, 01:45 PM
@MacrinM, please correct me if I'm wrong but as I understand what you're doing is not similar to god's eye. What you're doing is server side and you allow players to see status by web. God's eye is a client that "talks" to the dominions server and report back to the player, all this w/o ever loading dominions. This is what I'm looking for.
MarcinM
October 24th, 2006, 05:29 PM
Yes, sorry, my "yes, that's what I'm doing" was supposed to follow a quote from Gandalf Parker. Sorry for the confusion.
Sounds like you need to solicit the devs or Mr. Shoeller, as both of our solutions rely on making the logfile web-accessible.
WraithLord
October 24th, 2006, 08:02 PM
Dear IW devs, if you by chance happen to read this and are agreeable to disclose this information I for one, would really appreciate it (and I think whatever script I'll come up with may be useful for other players).
Of course, you may have your reasons not to want to disclose this, this perfectly understandable.
Ahmm, come to think of this, I can probably get this information by myself (low level net. protos. + crypto is what brings food to my table http://forum.shrapnelgames.com/images/smilies/wink.gif ), but I won't do so without an explicit permission.
Anyways, its just a nice to have thing. I guess I'll let it drop.
MarcinM
November 2nd, 2006, 06:15 PM
Ever get an answer for this, WraithLord? Or anyone discover anything?
NickW
November 2nd, 2006, 07:02 PM
I did an ethereal capture just to see if any obvious information was in ascii or otherwise visible but it doesn't look like it.
If Illwinter wants to provide the protocol information just for the game status packets I could quite easily whip up something that would probe a server for game status but I don't have the time to try decoding their protocol the hard way. I've got more valuable things to do with my time, like playing Dominions!
WraithLord
November 2nd, 2006, 07:27 PM
IW has been generous enough to help with the protocol details, and I'm almost done with a small utility that checks the turn status, I'll post it here when its complete.
I don't care much for GUI (that is, I care, but I'm little fond of writing it), so I gave it a CLI interface.
NickW
November 2nd, 2006, 11:45 PM
Those protocol details posted anywhere public?
WraithLord
November 3rd, 2006, 06:51 PM
Not AFAIK.
Johan K
November 3rd, 2006, 08:13 PM
// ------------------------------------------
// ------------ Packet Description ----------
// ------------------------------------------
/* 1 char 102 (magic)
1 char 72 (magic)
1 int data length (x bytes)
x bytes packet data
All short and ints are sent in little endian (x86) format. Least significant byte first!
*/
/* Keep alive byte
1 char 101 (magic)
Sometimes the server might send out this byte instead of a proper packet
to check if connections are still up. It should be silently ignored. */
// ------------------------------------------
// ----- important packets to server --------
// ------------------------------------------
/* Info request. Requests a status update from the server.
1 char 3
*/
/* Disconnect. Send this and wait for reply before disconnecting.
1 char 11
*/
// ------------------------------------------
// ----- important packets from server ------
// ------------------------------------------
/* Status update.
1 char 4
1 int network protocol version
1 char status (2=waiting)
1 str game name
1 char era (new in dom3)
1 char magic = 45 (new in dom3)
1 int ms left till host time
1 str message from host (unused)
P chars players controlled by (0=no one 1=human 2=AI)
P chars nationstatus
P chars connected or not
1 int turn nbr
1 char 0
*/
/* Disconnect reply. Wait for this before disconnecting.
1 char 12
*/
P = max number of nations = 80
Gandalf Parker
November 3rd, 2006, 08:33 PM
OK I was right. I wont be creating anything with that. http://forum.shrapnelgames.com/images/smilies/happy.gif
Johan K
November 4th, 2006, 02:24 AM
If you are interested in doing something similar I could post the details for the game status retrieving part here.
Gandalf Parker
November 4th, 2006, 03:02 AM
Im curious about it.
I doubt if Id be capable of programming anything to it at my level of programming but until I see the protocol I wont know.
NickW
November 4th, 2006, 04:37 AM
Johan K said:
If you are interested in doing something similar I could post the details for the game status retrieving part here.
I would be very much interested.
Arralen
November 4th, 2006, 04:58 AM
Me too.
MarcinM
November 10th, 2006, 12:48 AM
Awright, I got the server to talk to me, but I don't get the way the packet is constructed. I can see the name of the game, then a couple of zeros, then the magic 45 char, ... and then about 200 characters that don't make any sense to me, followed by the # of the turn.
How do I figure out what in those 200 corresponds to what nation, how it's controller and its connection status?
Thanks.
WraithLord
November 10th, 2006, 08:00 AM
I've uploaded said CLI here (http://www.shrapnelcommunity.com/threads/showflat.php?Cat=&Number=468595&page=0&view=collap sed&sb=5&o=2&fpart=1)
@MarcinM, the answers to your questions are in Johan's post.
MarcinM
November 10th, 2006, 11:08 AM
-10 points for reading comprehension.
I do not understand how:
1 int ms left till host time
1 str message from host (unused)
P chars players controlled by (0=no one 1=human 2=AI)
P chars nationstatus
P chars connected or not
maps to ~200 assorted zeros and ones. That is what I need a bit of help with.
WraithLord
November 10th, 2006, 12:19 PM
http://forum.shrapnelgames.com/images/smilies/happy.gif
I think it should be ~260. If you get 200 bytes response most likely something has gone wrong.
MarcinM
November 10th, 2006, 12:45 PM
Go on .....
Johan K
November 10th, 2006, 02:17 PM
3*P = 3*80 = 240 assorted zeroes and ones. "1 str message..." is just one byte (a zero).
MarcinM
November 10th, 2006, 05:50 PM
Oh, I think I figured it out. I should have looked at this in the first place:
http://www.dom3minions.com/docs/nations.txt
All is clear now (I think).
Johan K
November 12th, 2006, 09:34 AM
Good, then I won't have to answer your PM.
wzrd
June 16th, 2008, 01:06 AM
MarcinM said:
Oh, I think I figured it out. I should have looked at this in the first place:
http://www.dom3minions.com/docs/nations.txt
All is clear now (I think).
This list doesn't exist anymore. Is there anywhere else that lists this information out?
Thanks
Matt
Ballbarian
June 16th, 2008, 01:10 AM
<font class="small">Code:</font><hr /><pre>
EA 0 Arcoscephale
EA 1 Ermor
EA 2 Ulm
EA 3 Marverni
EA 4 Sauromatia
EA 5 T'ien Ch'i
EA 7 Mictlan
EA 8 Abysia
EA 9 Caelum
EA 10 C'tis
EA 11 Pangaea
EA 12 Agartha
EA 13 Tir na n'Og
EA 14 Fomoria
EA 15 Vanheim
EA 16 Helheim
EA 17 Niefelheim
EA 18 Kailasa
EA 19 Yomi
EA 20 Hinnom
EA 21 SEA Atlantis
EA 22 SEA R'lyeh
EA 26 SEA Oceania
EA 68 Lanka
MA 27 Arcoscephale
MA 28 Ermor
MA 29 Pythium
MA 30 Man
MA 31 Ulm
MA 32 Marignon
MA 33 Mictlan
MA 34 T'ien Ch'i
MA 35 Machaka
MA 36 Agartha
MA 37 Abysia
MA 38 Caelum
MA 39 C'tis
MA 40 Pangaea
MA 41 Vanheim
MA 42 Jotunheim
MA 43 Bandar Log
MA 44 Shinuyama
MA 45 Ashdod
MA 46 SEA Atlantis
MA 47 SEA R'lyeh
MA 48 SEA Oceania
MA 69 Eriu
LA 49 Arcoscephale
LA 50 Ermor
LA 51 Man
LA 52 Ulm
LA 53 Marignon
LA 54 Mictlan
LA 55 T'ien Ch'i
LA 56 Jomon
LA 57 Agartha
LA 58 Abysia
LA 59 Caelum
LA 60 C'tis
LA 61 Pangaea
LA 62 Midgard
LA 63 Utgard
LA 64 Patala
LA 65 Gath
LA 66 Atlantis
LA 67 SEA R'lyeh
LA 70 Pythium
LA 71 Bogarus
</pre><hr />
wzrd
June 16th, 2008, 04:11 PM
You are completely awesome, thanks.
Is that in some file somewhere I just didn't know where to look? For future reference. http://forum.shrapnelgames.com/images/smilies/happy.gif
MaxWilson
June 16th, 2008, 04:17 PM
Well, the mod manual PDF in the dom3 \doc directory has most of it, except for the nations that have been added since the game was released. For those I guess you just have to start up the game and look at the list of displayed nations for each era, and interpolate.
Good job, Ballbarian, on pulling together a complete list so quickly. http://forum.shrapnelgames.com/images/smilies/happy.gif It's useful to those who are AFG like me.
-Max
Endoperez
June 16th, 2008, 04:20 PM
MaxWilson said:
Well, the mod manual PDF in the dom3 \doc directory has most of it, except for the nations that have been added since the game was released.
It's actually been updated every once in a while. It didn't have everything last time I checked, but it had some of the nations added in patches.
Ballbarian
June 16th, 2008, 09:33 PM
Is that in some file somewhere I just didn't know where to look? For future reference.
I got the initial list from Gandalf and modified it for use with my various programs that utilize nation info. As the nations have been added, I have updated my list. The above list is just a copy paste from NationData.txt included with my GodEdit project. I am not sure, but I bet you could have gotten the numbers from Edi's database as well. If you haven't downloaded it, I highly recommend it. It is a very informative and extensive resource. http://forum.shrapnelgames.com/images/smilies/happy.gif
vBulletin® v3.8.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.