Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 14:25

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: lpatcher http redirect for cod4 and rest of cods
PostPosted: 18 Feb 2011 15:06 

Joined: 28 Sep 2009 21:30
Posts: 39
By default if you don't host from a http:// redirect in CoD4 or any of the CoD series of games the max upload speed would be 20k. I wonder if there is a way to overide this instead of redirecting people to a website to download the mods or maps? I know the upload speed of my server box located in a datacenter is wayyyyyyyyyyy faster than our website's upload speed.

Anyhow, just thought I would ask if this would be possible. Thanks again for your help with making the code for the mods filter with use with the lpatcher aLuigi! :)


Top
 Profile  
 
 
 Post subject: Re: lpatcher http redirect for cod4 and rest of cods
PostPosted: 18 Feb 2011 17:28 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
isn't sv_maxRate the cvar that handles the maximum speed of the downloads?


Top
 Profile  
 
 Post subject: Re: lpatcher http redirect for cod4 and rest of cods
PostPosted: 19 Feb 2011 04:00 

Joined: 28 Sep 2009 21:30
Posts: 39
sv_maxRate controls rate of data exchange between server and player however, it doesn't effect download speeds.


Top
 Profile  
 
 Post subject: Re: lpatcher http redirect for cod4 and rest of cods
PostPosted: 19 Feb 2011 13:03 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
sv_maxrate handles also the in-game downloads because the quake 3 engine considers them as part of the in-game connection, you can see that in the source code at line 857 of sv_client.c in quake3-1.32b.

indeed the same code exists also in cod4:
Code:
0052C2C6  |> 8B0D 68C48501     MOV ECX,DWORD PTR DS:[185C468]           ;  iw3mp.0CBB41C8
0052C2CC  |. 8B41 0C           MOV EAX,DWORD PTR DS:[ECX+C]
0052C2CF  |. 85C0              TEST EAX,EAX
0052C2D1  |. 8BBD F0040800     MOV EDI,DWORD PTR SS:[EBP+804F0]
0052C2D7  |. 74 26             JE SHORT iw3mp.0052C2FF
0052C2D9  |. 3D E8030000       CMP EAX,3E8
0052C2DE  |. 7D 16             JGE SHORT iw3mp.0052C2F6
0052C2E0  |. 6A 00             PUSH 0
0052C2E2  |. 51                PUSH ECX
0052C2E3  |. B9 E8030000       MOV ECX,3E8
0052C2E8  |. E8 13060400       CALL iw3mp.0056C900
0052C2ED  |. 8B0D 68C48501     MOV ECX,DWORD PTR DS:[185C468]           ;  iw3mp.0CBB41C8
0052C2F3  |. 83C4 08           ADD ESP,8
0052C2F6  |> 8B49 0C           MOV ECX,DWORD PTR DS:[ECX+C]
0052C2F9  |. 3BCF              CMP ECX,EDI
0052C2FB  |. 7D 02             JGE SHORT iw3mp.0052C2FF
0052C2FD  |. 8BF9              MOV EDI,ECX
so sv_maxrate is the easy way to boost the downloads, anyway it costed me nothing to make something to force a higher rate so the following is the usual patch for lpatch:
Code:
====================================================================================

TITLE
    Call of Duty 4 server in-game downloads booster
    by Luigi Auriemma

FILE
    *mp.exe

BYTES_ORIGINAL
    8B 0D ?? ?? ?? 01   ; MOV ECX,DWORD PTR DS:[185C468]
    8B 41 0C            ; MOV EAX,DWORD PTR DS:[ECX+C]
    85 C0               ; TEST EAX,EAX
    8B BD ?? ?? ?? 00   ; MOV EDI,DWORD PTR SS:[EBP+804F0]
    74 ??               ; JE SHORT iw3mp.0052C2FF
    3D E8 03 00 00      ; CMP EAX,3E8
    7D ??               ; JGE SHORT iw3mp.0052C2F6

BYTES_PATCH
    ?? ?? ?? ?? ?? ??   ; MOV ECX,DWORD PTR DS:[185C468]
    33 C0 90            ; XOR EAX,EAX + NOP
    ?? ??               ; TEST EAX,EAX
    BF DE C0 11 00      ; MOV EDI,iw3mp.00DEC0DE    // maxrate = 1163486
    90                  ; NOP                       // search 11 c0 de in the exe
                                                    // for modifying this value

====================================================================================
if it works (it must work) let me know what's the value you have chosen instead of 0x11c0de


Top
 Profile  
 
 Post subject: Re: lpatcher http redirect for cod4 and rest of cods
PostPosted: 19 Feb 2011 14:55 

Joined: 28 Sep 2009 21:30
Posts: 39
I will give it a shot here later today and let you know. Currently sv_maxrate is set to sv_maxrate 25000. I would imagine your patch would overide that setting or would I need to set that to sv_maxrate 1163486 after I apply your patch?


Top
 Profile  
 
 Post subject: Re: lpatcher http redirect for cod4 and rest of cods
PostPosted: 19 Feb 2011 17:45 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
when you apply it then sv_maxrate is no longer important.
anyway if you don't see effects you could also try to set sv_maxrate to that value as additional test.


Top
 Profile  
 
 Post subject: Re: lpatcher http redirect for cod4 and rest of cods
PostPosted: 20 Feb 2011 11:19 

Joined: 28 Sep 2009 21:30
Posts: 39
Alright I tested it out and its still only downloading at 20k max. So when I set sv_maxrate 1163486 it comes up with:

'1163486' is not a valid value for dvar 'sv_maxRate'
Domain is any integer from 0 to 25000


Top
 Profile  
 
 Post subject: Re: lpatcher http redirect for cod4 and rest of cods
PostPosted: 20 Feb 2011 20:51 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
just for curiosity:
what happens if you set big values (big but still in the limits of the game) in the cl_rate and cl_rate and cl_snaps on the client?

as visible in the source code the download speed is calculated on these 2 values


Top
 Profile  
 
 Post subject: Re: lpatcher http redirect for cod4 and rest of cods
PostPosted: 21 Feb 2011 01:27 

Joined: 28 Sep 2009 21:30
Posts: 39
The command for rate for a client is:

rate

and snaps for a client is:

snaps

The highest you can set the rate to is 25000 and the highest you can set snaps to is 30. For example I have my config set to:

/snaps 30

/cl_maxpackets 100

This gives me better registration and actually drops my in game ping up to 10 less than default.

Anyhow, I appreciate your efforts with this aLuigi. What I am going to do is just host a website off of our server box and go that route.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: