OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
Loading...
Searching...
No Matches
server_eye_test Namespace Reference

Classes

class  Walker

Functions

 game_log (home)
 frames (home)
 main ()

Variables

 ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
str MOD = 'eyetest'
float WALK_BOB = 0.5
float AIR_BOB = 0.05
str GAMETYPE
str VEC = r'\‍((-?[\d.e+-]+), (-?[\d.e+-]+), (-?[\d.e+-]+)\‍)'
 FRAME = re.compile(r'eyetest frame (\d) ' + VEC + ' ' + VEC)

Detailed Description

The server's eye of a player bobs while walking and not in the air, as 1.3.

    python3 scripts/server_eye_test.py /path/to/CoD2 --protocol {115|118} [--binary PATH]

Writes a mod in a temporary home folder whose dm gametype logs, every server
frame, whether the first player is on the ground, its origin and its eye
(libcod's getViewOrigin, the G_GetPlayerViewOrigin shots start from; the
stock getEye is the origin raised 40 units). A minimal client
(hit_location_test's) keeps walking forward; three times the mod throws it
straight up with libcod's setVelocity (the minimal client has no jump key),
and in the air it clears the horizontal velocity the air control adds just
before it reads the eye. 1.3 (0x4fddb6) bobs the eye sideways
by the bob cycle and the horizontal speed (0x4fde06): the cycle a walk left
stays in the air, the horizontal speed there is 0. (Standing still resets the
cycle, so a jump from a stop shows nothing.)
Exits with 0 when the walking eye moves sideways off the origin, the eye in
the air stays over it, and nothing crashed.

Function Documentation

◆ frames()

server_eye_test.frames ( home)
(on ground, origin, sideways offset of the eye from the origin) per
traced frame.

◆ game_log()

server_eye_test.game_log ( home)

◆ main()

server_eye_test.main ( )

Variable Documentation

◆ AIR_BOB

float server_eye_test.AIR_BOB = 0.05

◆ FRAME

server_eye_test.FRAME = re.compile(r'eyetest frame (\d) ' + VEC + ' ' + VEC)

◆ GAMETYPE

str server_eye_test.GAMETYPE

◆ MOD

str server_eye_test.MOD = 'eyetest'

◆ ROOT

server_eye_test.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

◆ VEC

str server_eye_test.VEC = r'\‍((-?[\d.e+-]+), (-?[\d.e+-]+), (-?[\d.e+-]+)\‍)'

◆ WALK_BOB

float server_eye_test.WALK_BOB = 0.5