Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » The_Game()->MVPName
The_Game()->MVPName [message #356030] Mon, 27 October 2008 14:09 Go to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
if you compile a plugin with this code (also in the debugger)

DLLEXPORT void SSGM_GameOver_Hook()
{
	char MVP[32];
	sprintf(MVP,"%s",The_Game()->MVPName); //MVP = 0x0013ec8c ""
	if (strlen((const char *)MVP) <= 1)
	{
		sprintf(MVP,"%s","NULL");
	}
	printf("[game_end] %s %u %u %u %d %s\n",Data->CurrMap,The_Game()->GameDuration_Seconds,The_Game()->WinType,The_Game()->WinnerID,Get_Team_Score(The_Game()->WinnerID),MVP);
}


it will error at the printf..
this is because:
when there are no players ingame there is no MVP.
therefore The_Game()->MVPName is...
Dante

reading the memory space of where the "mvp name" is supposed to be


MVP = 0x0013ec8c ""
First-chance exception at 0x0238dbc6 (Plugin.dll) in server.dat: 0xC0000005: Access violation reading location 0x40b38800



Fix for v4.0 please Very Happy


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*

[Updated on: Mon, 27 October 2008 14:10]

Report message to a moderator

Re: The_Game()->MVPName [message #356034 is a reply to message #356030] Mon, 27 October 2008 14:33 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
Theres nthing wrong, i rememebr some servers that gave you some Specials when you were MVP, its a while ago
Re: The_Game()->MVPName [message #356035 is a reply to message #356030] Mon, 27 October 2008 14:36 Go to previous messageGo to next message
Ghostshaw is currently offline  Ghostshaw
Messages: 709
Registered: September 2006
Karma: 0
Colonel
TheGame is actually stuff in renegade it self, and we won't fix this, you should simply check wether there are players.

BlackIntel Administrator

[Updated on: Mon, 27 October 2008 14:42]

Report message to a moderator

Re: The_Game()->MVPName [message #356048 is a reply to message #356035] Mon, 27 October 2008 15:46 Go to previous messageGo to next message
EvilWhiteDragon is currently offline  EvilWhiteDragon
Messages: 3751
Registered: October 2005
Location: The Netherlands
Karma: 0
General (3 Stars)

Ghostshaw wrote on Mon, 27 October 2008 22:36

TheGame is actually stuff in renegade it self, and we won't fix this, you should simply check wether there are players.

^^ that seems rather logical to me. First check if something exist before requesting it. That can't be that hard.


http://www.blackintel.org/usr/evilwhitedragon/pointfix.gif
BlackIntel admin/founder/PR dude (not a coder)
Please visit http://www.blackintel.org/

V, V for Vendetta

People should not be afraid of their governments.
Governments should be afraid of their people.
Re: The_Game()->MVPName [message #356052 is a reply to message #356030] Mon, 27 October 2008 16:14 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

Can't you check for The_Game()->MVPName.Is_Empty() or similar?

BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: The_Game()->MVPName [message #356061 is a reply to message #356030] Mon, 27 October 2008 17:58 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
Was just asking. -_-
I didnt come here to get a stick shoved up my butt for finding this.


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: The_Game()->MVPName [message #356083 is a reply to message #356061] Tue, 28 October 2008 00:44 Go to previous messageGo to next message
Goztow is currently offline  Goztow
Messages: 9743
Registered: March 2005
Location: Belgium
Karma: 14
General (5 Stars)
Goztoe
halo2pac wrote on Tue, 28 October 2008 01:58

Was just asking. -_-
I didnt come here to get a stick shoved up my butt for finding this.

I don't see any sticks, I just see people trying to help you.


You can find me in The KOSs2 (TK2) discord while I'm playing. Feel free to come and say hi! TK2 discord
Re: The_Game()->MVPName [message #356086 is a reply to message #356030] Tue, 28 October 2008 00:56 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
sprintf(MVP,"%S", (const wchar_t *)The_Game()->MVPName);


There's nothing wrong with it, garbage in, garbage out.

[Updated on: Tue, 28 October 2008 00:56]

Report message to a moderator

Re: The_Game()->MVPName [message #356147 is a reply to message #356030] Tue, 28 October 2008 12:10 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
yes I tried that, Dante told me to try that.
It crashes.


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: The_Game()->MVPName [message #356164 is a reply to message #356147] Tue, 28 October 2008 13:59 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
halo2pac wrote on Tue, 28 October 2008 19:10

yes I tried that, Dante told me to try that.
It crashes.


Probably crashing elsewhere then.
Re: The_Game()->MVPName [message #356184 is a reply to message #356030] Tue, 28 October 2008 16:55 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
If I take those few lines out the thing runs perfect...

http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: The_Game()->MVPName [message #356256 is a reply to message #356030] Wed, 29 October 2008 05:52 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
Comment out the printf at the bottom and see if it still crashes.
Re: The_Game()->MVPName [message #356287 is a reply to message #356030] Wed, 29 October 2008 12:03 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
if you take out the printf it doesnt crash.

Its just that MVPName is supposed to be null. Becuase there was no mvp. But instead its...

Dante

reading the memory space of where the "mvp name" is supposed to be.


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: The_Game()->MVPName [message #356291 is a reply to message #356287] Wed, 29 October 2008 12:14 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
halo2pac wrote on Wed, 29 October 2008 19:03

if you take out the printf it doesnt crash.

Its just that MVPName is supposed to be null. Becuase there was no mvp. But instead its...

Dante

reading the memory space of where the "mvp name" is supposed to be.



No, actually it's a WideStringClass and cannot be null.

It's crashing at the printf because Data->CurrMap is an std::string. Not a C string.
Re: The_Game()->MVPName [message #356360 is a reply to message #356030] Wed, 29 October 2008 16:47 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
ok then lets put it this way. if i take out the MVPName it works fine with the mapname.

http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: The_Game()->MVPName [message #356556 is a reply to message #356360] Fri, 31 October 2008 07:24 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3813
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
char string[1000];
sprintf(string,"MESSAGE Example: Text String From Object %d.",Get_ID(obj));
Console_Input(string);

Don't use printf to print text, do something like that instead.


[Updated on: Wed, 12 November 2008 08:32]

Report message to a moderator

Re: The_Game()->MVPName [message #356557 is a reply to message #356030] Fri, 31 October 2008 07:34 Go to previous messageGo to next message
Ghostshaw is currently offline  Ghostshaw
Messages: 709
Registered: September 2006
Karma: 0
Colonel
Erm don't you mean Console_Output jerad? But yeah printf doesn't work properly in some cases in the FDS.

BlackIntel Administrator
Re: The_Game()->MVPName [message #356585 is a reply to message #356030] Fri, 31 October 2008 12:09 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
Actually I'm sending it to my website with a socket ^^
printf was just there to show me where its crashing...
it crashes with the printf or Thinngy.Send

but If I remove the MVPName it works fine.
MVPName is just null.. but its not null.... Like Dante Said.
So u cant check to see if its null.


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: The_Game()->MVPName [message #356796 is a reply to message #356035] Sat, 01 November 2008 22:04 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
Ghostshaw wrote on Mon, 27 October 2008 14:36

TheGame is actually stuff in renegade it self, and we won't fix this, you should simply check wether there are players.



^^^
Re: The_Game()->MVPName [message #358274 is a reply to message #356557] Wed, 12 November 2008 08:32 Go to previous message
Jerad2142 is currently offline  Jerad2142
Messages: 3813
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Ghostshaw wrote on Fri, 31 October 2008 08:34

Erm don't you mean Console_Output jerad? But yeah printf doesn't work properly in some cases in the FDS.

Never even thought to check if it existed, it works the same as long as you type MESSAGE before your message.


Previous Topic: Edit_
Next Topic: Sound bug
Goto Forum:
  


Current Time: Thu Feb 06 13:31:44 MST 2025

Total time taken to generate the page: 0.01164 seconds