Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Server.dat patch
Server.dat patch [message #443566] Sat, 05 February 2011 09:08 Go to next message
PsuFan is currently offline  PsuFan
Messages: 441
Registered: February 2007
Karma: 0
Commander
Is there a newer server.dat patch that stops the server from processing all the objects while no ones ingame? Its not noticeable on normal servers, but hosting RP2 sucks when the servers processing thousands of objects for no one to see.

Re: Server.dat patch [message #443574 is a reply to message #443566] Sat, 05 February 2011 13:48 Go to previous messageGo to next message
cAmpa is currently offline  cAmpa
Messages: 597
Registered: March 2006
Karma: 0
Colonel
RR fixed it too.

You can choose there:
Quote:


emptyTeamBehaviour = 'ignore'; // sets what will happen if one team runs out of players:
// 'default' - default Renegade behavior: the game is paused
// 'ignore' - the game can be played as if there are players on both teams (choose this for co-op)
// 'interrupt' - the game will be interrupted (no damage allowed, but anything else can be done)


Bückstabü!
Re: Server.dat patch [message #443616 is a reply to message #443574] Sun, 06 February 2011 12:24 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
cAmpa wrote on Sat, 05 February 2011 13:48

RR fixed it too.

You can choose there:
Quote:


emptyTeamBehaviour = 'ignore'; // sets what will happen if one team runs out of players:
// 'default' - default Renegade behavior: the game is paused
// 'ignore' - the game can be played as if there are players on both teams (choose this for co-op)
// 'interrupt' - the game will be interrupted (no damage allowed, but anything else can be done)


Is this even after the no gameplay pending patch?


Re: Server.dat patch [message #443617 is a reply to message #443566] Sun, 06 February 2011 12:56 Go to previous messageGo to next message
PsuFan is currently offline  PsuFan
Messages: 441
Registered: February 2007
Karma: 0
Commander
I was kinda looking for something with less overhead, I tried it, it killed me constantly and disconnected me from spamming private messages about picking up some powerup. Is there just a better server.dat out there?

Re: Server.dat patch [message #443631 is a reply to message #443566] Sun, 06 February 2011 21:57 Go to previous messageGo to next message
Lone0001 is currently offline  Lone0001
Messages: 2112
Registered: August 2006
Location: Ontario, Canada
Karma: 0
General (2 Stars)

YaRR has this built into it or something similar to it, you could look at its source.

It paused the game when no one was in it, it also had commands that you could use to pause and start it again, !stop and !start I think.


[Updated on: Sun, 06 February 2011 22:04]

Report message to a moderator

Re: Server.dat patch [message #443652 is a reply to message #443566] Mon, 07 February 2011 14:28 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
I have seen this in Yarr's source, so I can confirm.

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: Server.dat patch [message #443685 is a reply to message #443566] Tue, 08 February 2011 10:04 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)
Backup 6 bytes at 3 addresses: 0x474CF0, 0x4616A0, 0x0472c95

To pause,

Write {0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3} at 0x474CF0
Write {0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3} at 0x4616A0
Write {0x90, 0x90, 0x90, 0x90, 0x90, 0x90} at 0x0472c95

To resume, just restore the backed up bytes.



If you are using the LuaPlugin, the following code should work:

function Pause_Game()
	Stop_Game_Tmp = MemoryRead(0x474CF0, 6)
	NoGameover_Tmp = MemoryRead(0x4616A0, 6)
	Pause_Tmp = MemoryRead(0x0472c95, 6)
	
	MemoryWrite(0x474CF0, {0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3})
	MemoryWrite(0x4616A0, {0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3})
	MemoryWrite(0x0472c95, {0x90, 0x90, 0x90, 0x90, 0x90, 0x90})
end

function Resume()
	if NoGameover_Tmp == nil or Stop_Game_Tmp == nil or Pause_Tmp == nil then
		return
	end
	MemoryWrite(0x474CF0, Stop_Game_Tmp)
	MemoryWrite(0x4616A0, NoGameover_Tmp)
	MemoryWrite(0x0472c95, Pause_Tmp)	
end
Re: Server.dat patch [message #443705 is a reply to message #443685] Tue, 08 February 2011 19:56 Go to previous messageGo to next message
PsuFan is currently offline  PsuFan
Messages: 441
Registered: February 2007
Karma: 0
Commander
lmao, Dan your amazing. I thought you died! I haven't seen you on msn in a month. lol.

I havent tried it yet, ill let you know how it goes.

Edit:

Doesnt work so well, players cant join when paused and server games over on resume. Know any ways to fix this? The main reason I need this is because the server uses 50-80% cpu when no one is in the server. It would help greatly if I could pause it effectively. Check out this pic on pause, looks extremely promising.

index.php?t=getfile&id=13196&private=0
  • Attachment: CPU.png
    (Size: 20.56KB, Downloaded 578 times)


[Updated on: Tue, 08 February 2011 20:19]

Report message to a moderator

Re: Server.dat patch [message #443726 is a reply to message #443566] Wed, 09 February 2011 16:12 Go to previous messageGo to next message
snazy2000 is currently offline  snazy2000
Messages: 67
Registered: December 2007
Karma: 0
Recruit
Take a look at the PreJoin hook in YaRR. You could add the Resume Code in there. That should let players be able to join?? Maybe wrong but should work.
Re: Server.dat patch [message #443735 is a reply to message #443566] Thu, 10 February 2011 00:09 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)
I had a feeling they wouldn't be able to join, the prejoin hook like snazy suggested may work if hacking it doesn't stop that working too. If not then maybe setting the SFPS really low when no one is in game?

Again, code:

function SetSFPS(newSFPS) 
	MemoryWrite(0x43BAB9, {1000/newSFPS}) 
	MemoryWrite(0x43BAC0, {1000/newSFPS}) 
end


Oh, I don't have Lua code for a prejoin hook. It has to be done in C++.
Re: Server.dat patch [message #443740 is a reply to message #443735] Thu, 10 February 2011 07:20 Go to previous messageGo to next message
PsuFan is currently offline  PsuFan
Messages: 441
Registered: February 2007
Karma: 0
Commander
A) The resume code ends game, there's no way I can load the game before they join.
B) Can I get YaRR link, it's hard to find any of dans code anymore with no site.


Re: Server.dat patch [message #443741 is a reply to message #443740] Thu, 10 February 2011 07:34 Go to previous messageGo to next message
snazy2000 is currently offline  snazy2000
Messages: 67
Registered: December 2007
Karma: 0
Recruit
http://d3.ninjah-gaming.co.uk/products/yarr/yarr-0.7.0-setup.zip


[Updated on: Thu, 10 February 2011 07:34]

Report message to a moderator

Re: Server.dat patch [message #443757 is a reply to message #443566] Thu, 10 February 2011 21:47 Go to previous messageGo to next message
PsuFan is currently offline  PsuFan
Messages: 441
Registered: February 2007
Karma: 0
Commander
I tried setting the SFPS, it works decent, not anywhere close to gameplay pending, only about 30% CPU reduction (edit), it still runs around 45+, but Ill take what I can get, Im going to fry this fan running 24/7.

I can only set the sfps to 10, anything lower prevents joins, console commands, and crashes clients.

I tried looking for the prejoin in yarr, lmao, doesnt look easy to replicated in luaplugin with my C++ skills.


[Updated on: Thu, 10 February 2011 22:01]

Report message to a moderator

Re: Server.dat patch [message #443765 is a reply to message #443757] Fri, 11 February 2011 10:08 Go to previous messageGo to next message
snazy2000 is currently offline  snazy2000
Messages: 67
Registered: December 2007
Karma: 0
Recruit
Try and convert your LUA to c++?? Wink
Re: Server.dat patch [message #443767 is a reply to message #443765] Fri, 11 February 2011 10:43 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
snazy2000 wrote on Fri, 11 February 2011 10:08

Try and convert your LUA to c++?? Wink

LUA has the advantage of being able to be deployed into the game at run time, you don't have to exit the server and recompile to add new scripts. Thumbs Up

Plus there are going to be people out there that find higher level languages easier to use.


Re: Server.dat patch [message #443771 is a reply to message #443765] Fri, 11 February 2011 16:44 Go to previous messageGo to next message
PsuFan is currently offline  PsuFan
Messages: 441
Registered: February 2007
Karma: 0
Commander
snazy2000 wrote on Fri, 11 February 2011 12:08

Try and convert your LUA to c++?? Wink


It would be easier to just copy the c++ prejoin to luaplugin c++ and call lua, if I knew how, rather than relearning c++ and converting thousands of lines of code. It's not worth it. That method won't work 100% anyway, the server won't be able to reload the game while the player is in the game channel pushing the star button to join the game. They will most likely need to rejoin or load the level twice. Maybe I need a client connector to start the server before joining.


Re: Server.dat patch [message #443789 is a reply to message #443566] Sat, 12 February 2011 12:45 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)
As far as I can remember from testing the pause resume code, the game didn't end when it was paused an resumed when no one was in game. I should test it and maybe offer a potential fix. Can't make any promises though as I struggle to get on a computer for more than a couple of hours a week now. When this time last year is was 4 hours+ a day!

[Updated on: Sat, 12 February 2011 12:45]

Report message to a moderator

Re: Server.dat patch [message #443854 is a reply to message #443566] Tue, 15 February 2011 01:51 Go to previous messageGo to next message
abraham111 is currently offline  abraham111
Messages: 2
Registered: February 2011
Karma: 0
Recruit
I am little bit disappointed that nothing is mentioned about a better server.dat patch. I am going to try the method mentioned by jnZ. But I am little bit skeptical about the code. I really wonder whether it will work. Anyway I have decided to give it a try. I will soon let everybody know how it went.

"ALL IS WELL"
Re: Server.dat patch [message #443884 is a reply to message #443566] Tue, 15 February 2011 18:38 Go to previous message
PsuFan is currently offline  PsuFan
Messages: 441
Registered: February 2007
Karma: 0
Commander
I already gave the outcomes if you read above. Thumbs Up

Previous Topic: Assassin's Creed Models
Next Topic: Remove player list
Goto Forum:
  


Current Time: Sat Nov 09 05:28:36 MST 2024

Total time taken to generate the page: 0.01032 seconds