Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Information Gathering
Information Gathering [message #435291] Sun, 22 August 2010 09:55 Go to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
Well the title could probably be better but what the hell Rocked Over

I have a few questions I would like someone to answer:
1. How do I get the server IP when I'm a client through scripts/shaders?
2. How do I get the nickname I'm connecting with scripts/shaders? (a way that works with WOL and DirectConnect)
3. Can I easily get the server name through scripts or should I just read the "wGameTitle=" entry in "svrcfg_cnc.ini" (or what other file is selected in server.ini)?

I think that is it Thumbs Up


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg

[Updated on: Sun, 22 August 2010 09:58]

Report message to a moderator

Re: Information Gathering [message #435295 is a reply to message #435291] Sun, 22 August 2010 11:35 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Maybe you could hook the client's XWIS connection and get the information that way?


Re: Information Gathering [message #435299 is a reply to message #435291] Sun, 22 August 2010 13:36 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
True, I can indeed do that (i could even kick players on the server that are not on WOL/XWIS but w/e Razz ) though that would only work when using WOL/XWIS, not for clients that use DirectConnect Sad

http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg
Re: Information Gathering [message #435300 is a reply to message #435291] Sun, 22 August 2010 14:06 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
I was referring to hooking the clients connection, not the server's. However, you're right, that would only work for XWIS clients.

I suppose you could hook the client chat, and have the server send this information on player join?

What you really want to do is actually possible, as I have inquired about this too, but I am not sure how.



[Updated on: Sun, 22 August 2010 14:08]

Report message to a moderator

Re: Information Gathering [message #435419 is a reply to message #435291] Tue, 24 August 2010 15:22 Go to previous messageGo to next message
dr3w2 is currently offline  dr3w2
Messages: 485
Registered: September 2006
Location: Ottawa,Canada
Karma: 0
Commander
Not sure which if all of your questions were based client side or server side.
Anyways this is what I did client side, using shaders.dll

Omar007 wrote on Sun, 22 August 2010 11:55

1. How do I get the server IP when I'm a client through scripts/shaders?


int server_ip = The_Game()->IP;

The resulting IP is in integer/long notation, you'll have to convert it if you want it string dotted notation. One method of conversion is the following:

struct in_addr addr;
addr.s_addr = The_Game()->IP;
char *dot_ip = inet_ntoa(addr);


Omar007 wrote on Sun, 22 August 2010 11:55

2. How do I get the nickname I'm connecting with scripts/shaders? (a way that works with WOL and DirectConnect)


To my knowledge, this can only be called AFTER the first frame has been drawn. When I tried calling it otherwise I received a null pointer on obj.

GameObject *obj = (GameObject *)(*TheStar)->obj;
char *player_name = Get_Player_Name(obj);


Omar007 wrote on Sun, 22 August 2010 11:55

3. Can I easily get the server name through scripts or should I just read the "wGameTitle=" entry in "svrcfg_cnc.ini" (or what other file is selected in server.ini)?

Do you mean xwis/wol server name or server name/title? The following below gets the game title (Ex: n00bstories AOW)

char *server_name = WideCharToChar(The_Game()->GameTitle);


n00bstories Server Administrator

[Updated on: Tue, 24 August 2010 15:36]

Report message to a moderator

Re: Information Gathering [message #435422 is a reply to message #435291] Tue, 24 August 2010 16:52 Go to previous message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
Ah nice thanks! I'll be trying those asap Thumbs Up
A fast peak did show me The_Game()->... has some great stuff in it Thumbs Up


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg
Previous Topic: "Reborn Hud"
Next Topic: Renegade X is looking for Coders and Character Artists
Goto Forum:
  


Current Time: Tue Nov 12 22:51:25 MST 2024

Total time taken to generate the page: 0.00989 seconds