-
Notifications
You must be signed in to change notification settings - Fork 18
/
readme.!!!
106 lines (84 loc) · 3.76 KB
/
readme.!!!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
bullet trace hook:
~~~~~~~~~~~~~~~~~~
(from game/g_weapon.c :: fire_lead())
// check fire output from bbox
gi.trace(self->s.origin%, NULL, NULL, start#, self%, MASK_SHOT)
// check dst
gi.trace(start#, NULL, NULL, end, self%, content_mask)
if (tr & MASK_WATER)
{
if (start != tr.endpos) Multicast(splash)
water_start = tr.endpos
end2 = water_start -> dir(8192) + spread
gi.trace(water_start, NULL, NULL, end2, self%, MASK_SHOT)
}
may_be: Multicast(impact) -- sparks
...
NOTES:
- &self->s.origin == self + 4
- content_mask == MASK_SHOT || MASK_SHOT|MASK_WATER
- dist(self->s.origin, start) -- near
- dist(start,end) ~ 8192 (with spread)
- shooting: start->end
? check shotgun (not bullet weapon) (repeat at least 10 times with the same "start" and "self")
Use for:
- tracers
* correct metal sparks angle
- bullet nearby-fly sound
-------------------------------
sv_fps:
~~~~~~~
- sv_main.c
- cl_ents.c
- CL_ParseFrame() (look for const 100)
- CL_AddPacketEntities() (EF_ANIM_ALLFAST; not depends on sv_fps -- fixed 10Hz)
- CL_CalcViewValues() ("smooth out stair climbing" ??)
- CL_AddEntities() (computions of cl.lerpfrac etc.)
- cl_pred.c ? (computions of predictLerp)
? cl_input.c
- KeyDown()
- CL_FinishMove()
- cl_newfx.c
- CL_Flashlight() (unused ??), CL_ColorFlash()
- cl_tent.c
- CL_AllocExplosion() (starting time = -100ms ??)
? CL_AddExplosions() (computing frac; BUT: frame rate is 10Hz - not depends on sv_fps)
- CL_ParsePlayerBeam() (beam life time)
- CL_ParseLaser() (lifetime)
? CL_ParseSteam() (thinkinterval)
-------------------------------
usercmd_t.impulse is unused byte field
-------------------------------
Spawn entities:
game\g_spawn.c SpawnEntities() -> ED_CallSpawn (edict_t *ent)
g_target.c SP_target_spawner (...) -> use_target_spawner (...) -> ED_CallSpawn (...)
m_medic.c medic_cable_arrack (...) -> ED_CallSpawn (...)
SpawnEntities() exported from game
server\sv_init.c SV_SpawnServer () -> ge->SpawnEntities (...)
----------------------------------------
New server:
~~~~~~~~~~~
we can detect new server by parsing response on "info" command. Response have following format:
appSprintf (string, sizeof(string), "%16s %8s %2i/%2i\n", hostname->string, sv.name, count, (int)maxclients->value);
(server/sv_main.c :: SVC_Info())
Command is send in menu system and only when connecting within menu; when "connect <addr>" used, "info" is not sending!
(we can do it manually)
Response received in (cl_main.c :: CL_ConnectlessPacket() -> CL_ParseStatusMessage()) and analyzed in
(client/menu.c :: M_AddToServerList())
--OR--
we can add extra bytes to any packet
--OR--
we can send extra info in "stat" server responce (currently: cheats, mapname ...)
----------------------------------------
?? game/g_main.c sets "ge" ("globals") variable. It contains "edict_size" field!
ALL common (visible to server) game structures are declared in game/game.h;
game-specific fields for this strucs are in g_local.h;
common (game and server) strucs/declares - in q_shared.h
edict_t (edict_s) declared in game/game.h; this file is used by server.h, so we can assume, that
this structure have some fixed fields but game may adds additional fields and change ge.edict_size)
entity_state_t declared in game/q_shared.h (static format)
entity_state_t filled in server/sv_ents.c::SV_BuildClientFrame(client)
it is COPIED from game edicts onto svs.client_entities - each client record on server have its own copy!
(we can change s.frame, s.event etc. for concrete client (i.e. with NEW_PROTOCOL_ID))
Basic animations and frame inc/dec are set in game/p_view.c::Q_SetClientFrame()
Note: anim_end is inaccessible!