C# Class SharpQuake.Server

Exibir arquivo Open project: Memorix101/SharpQuake

Public Methods

Method Description
AllocEdict ( ) : edict_t

ED_Alloc Either finds a free edict, or allocates a new one. Try to avoid reusing an entity that was recently freed, because it can cause the client to think the entity morphed into something else instead of being removed and recreated, which can cause interpolated angles and bad trails.

CheckBottom ( edict_t ent ) : bool

SV_CheckBottom

ClearWorld ( ) : void

SV_ClearWorld called after the world model has been loaded, before linking any entities

EdictNum ( int n ) : edict_t

EDICT_NUM

EdictToProg ( edict_t e ) : int

EDICT_TO_PROG(e)

FreeEdict ( edict_t ed ) : void

ED_Free Marks the edict as free FIXME: walk all entities and NULL out references to this entity

LinkEdict ( edict_t ent, bool touch_triggers ) : void

SV_LinkEdict Needs to be called any time an entity changes origin, mins, maxs, or solid flags ent->v.modified sets ent->v.absmin and ent->v.absmax if touchtriggers, calls prog functions for the intersected triggers

Move ( Vector3 &start, Vector3 &mins, Vector3 &maxs, Vector3 &end, int type, edict_t passedict ) : trace_t

SV_Move mins and maxs are relative if the entire move stays in a solid volume, trace.allsolid will be set if the starting point is in a solid, it will be allowed to move out to an open area nomonsters is used for line of sight or edge testing, where mosnters shouldn't be considered solid objects passedict is explicitly excluded from clipping checks (normally NULL)

MoveStep ( edict_t ent, v3f &move, bool relink ) : bool

SV_movestep Called by monster program code. The move will be adjusted for slopes and stairs, but if the move isn't possible, no move is done, false is returned, and pr_global_struct.trace_normal is set to the normal of the blocking wall

MoveToGoal ( ) : void

SV_MoveToGoal

NumForEdict ( edict_t e ) : int

NUM_FOR_EDICT

Physics ( ) : void

SV_Physics

PointContents ( Vector3 &p ) : int

SV_PointContents

ProgToEdict ( int e ) : edict_t

PROG_TO_EDICT(e) Offset in bytes!

RecursiveHullCheck ( hull_t hull, int num, float p1f, float p2f, Vector3 &p1, Vector3 &p2, trace_t trace ) : bool

SV_RecursiveHullCheck

RunClients ( ) : void

SV_RunClients

SetIdealPitch ( ) : void

SV_SetIdealPitch

UnlinkEdict ( edict_t ent ) : void

SV_UnlinkEdict call before removing an entity, and before trying to move one, so it doesn't clip against itself flags ent->v.modified

Private Methods

Method Description
Accelerate ( ) : void

SV_Accelerate

AddGravity ( edict_t ent ) : void

SV_AddGravity

AirAccelerate ( Vector3 wishveloc ) : void

SV_AirAccelerate

AirMove ( ) : void

SV_AirMove

CheckStuck ( edict_t ent ) : void

SV_CheckStuck This is a big hack to try and fix the rare case of getting stuck in the world clipping hull.

CheckVelocity ( edict_t ent ) : void

SV_CheckVelocity

CheckWater ( edict_t ent ) : bool

SV_CheckWater

CheckWaterTransition ( edict_t ent ) : void

SV_CheckWaterTransition

ClientThink ( ) : void

SV_ClientThink the move fields specify an intended velocity in pix/sec the angle fields specify an exact angular motion in degrees

ClipMoveToEntity ( edict_t ent, Vector3 &start, Vector3 &mins, Vector3 &maxs, Vector3 &end ) : trace_t

SV_ClipMoveToEntity Handles selection or creation of a clipping hull, and offseting (and eventually rotation) of the end points

ClipToLinks ( areanode_t node, moveclip_t clip ) : void

SV_ClipToLinks Mins and maxs enclose the entire area swept by the move

ClipVelocity ( v3f &src, Vector3 &normal, v3f &dest, float overbounce ) : int

ClipVelocity Slide off of the impacting object returns the blocked flags (1 = floor, 2 = step / wall)

CloseEnough ( edict_t ent, edict_t goal, float dist ) : bool

SV_CloseEnough

CreateAreaNode ( int depth, Vector3 &mins, Vector3 &maxs ) : areanode_t

SV_CreateAreaNode

DropPunchAngle ( ) : void
FindTouchedLeafs ( edict_t ent, mnodebase_t node ) : void

SV_FindTouchedLeafs

FixCheckBottom ( edict_t ent ) : void

SV_FixCheckBottom

FlyMove ( edict_t ent, float time, trace_t steptrace ) : int

SV_FlyMove The basic solid body movement clip that slides along multiple planes Returns the clipflags if the velocity was modified (hit something solid) 1 = floor 2 = wall / step 4 = dead stop If steptrace is not NULL, the trace of any vertical wall hit will be stored

HullForBox ( Vector3 &mins, Vector3 &maxs ) : hull_t
HullForEntity ( edict_t ent, Vector3 &mins, Vector3 &maxs, Vector3 &offset ) : hull_t

SV_HullForEntity Returns a hull that can be used for testing or clipping an object of mins/maxs size. Offset is filled in to contain the adjustment that must be added to the testing object's origin to get a point to use with the returned hull.

HullPointContents ( hull_t hull, int num, Vector3 &p ) : int

SV_HullPointContents

Impact ( edict_t e1, edict_t e2 ) : void

SV_Impact Two entities have touched, so run their touch functions

InitBoxHull ( ) : void

SV_InitBoxHull Set up the planes and clipnodes so that the six floats of a bounding box can just be stored out and get a proper hull_t structure.

Move ( v3f &start, v3f &mins, v3f &maxs, v3f &end, int type, edict_t passedict ) : trace_t
MoveBounds ( Vector3 &start, Vector3 &mins, Vector3 &maxs, Vector3 &end, Vector3 &boxmins, Vector3 &boxmaxs ) : void

SV_MoveBounds

NewChaseDir ( edict_t actor, edict_t enemy, float dist ) : void

SV_NewChaseDir

Physics_Client ( edict_t ent, int num ) : void

SV_Physics_Client Player character actions

Physics_Noclip ( edict_t ent ) : void

SV_Physics_Noclip A moving object that doesn't obey physics

Physics_None ( edict_t ent ) : void

SV_Physics_None Non moving objects can only think

Physics_Pusher ( edict_t ent ) : void

SV_Physics_Pusher

Physics_Step ( edict_t ent ) : void

SV_Physics_Step

Physics_Toss ( edict_t ent ) : void

SV_Physics_Toss Toss, bounce, and fly movement. When onground, do nothing.

PushEntity ( edict_t ent, v3f &push ) : trace_t

PushEntity Does not change the entities velocity at all

PushMove ( edict_t pusher, float movetime ) : void

SV_PushMove

ReadClientMessage ( ) : bool

SV_ReadClientMessage Returns false if the client should be killed

ReadClientMove ( usercmd_t &move ) : void

SV_ReadClientMove

RunThink ( edict_t ent ) : bool

SV_RunThink Runs thinking code if time. There is some play in the exact time the think function will be called, because it is called before any movement is done in a frame. Not used for pushmove objects, because they must be exact. Returns false if the entity removed itself.

Server ( ) : System
StepDirection ( edict_t ent, float yaw, float dist ) : bool

SV_StepDirection Turns to the movement direction, and walks the current distance if facing it.

TestEntityPosition ( edict_t ent ) : edict_t

SV_TestEntityPosition This could be a lot more efficient...

TouchLinks ( edict_t ent, areanode_t node ) : void

SV_TouchLinks

TryUnstick ( edict_t ent, v3f &oldvel ) : int

SV_TryUnstick Player has come to a dead stop, possibly due to the problem with limited float precision at some angle joins in the BSP hull. Try fixing by pushing one pixel in each direction. This is a hack, but in the interest of good gameplay...

UserFriction ( ) : void

SV_UserFriction

WalkMove ( edict_t ent ) : void

SV_WalkMove Only used by players

WallFriction ( edict_t ent, trace_t trace ) : void

SV_WallFriction

WaterJump ( ) : void

SV_WaterJump

WaterMove ( ) : void

SV_WaterMove

Method Details

AllocEdict() public static method

ED_Alloc Either finds a free edict, or allocates a new one. Try to avoid reusing an entity that was recently freed, because it can cause the client to think the entity morphed into something else instead of being removed and recreated, which can cause interpolated angles and bad trails.
public static AllocEdict ( ) : edict_t
return edict_t

CheckBottom() public static method

SV_CheckBottom
public static CheckBottom ( edict_t ent ) : bool
ent edict_t
return bool

ClearWorld() public static method

SV_ClearWorld called after the world model has been loaded, before linking any entities
public static ClearWorld ( ) : void
return void

EdictNum() public static method

EDICT_NUM
public static EdictNum ( int n ) : edict_t
n int
return edict_t

EdictToProg() public static method

EDICT_TO_PROG(e)
public static EdictToProg ( edict_t e ) : int
e edict_t
return int

FreeEdict() public static method

ED_Free Marks the edict as free FIXME: walk all entities and NULL out references to this entity
public static FreeEdict ( edict_t ed ) : void
ed edict_t
return void

LinkEdict() public static method

SV_LinkEdict Needs to be called any time an entity changes origin, mins, maxs, or solid flags ent->v.modified sets ent->v.absmin and ent->v.absmax if touchtriggers, calls prog functions for the intersected triggers
public static LinkEdict ( edict_t ent, bool touch_triggers ) : void
ent edict_t
touch_triggers bool
return void

Move() public static method

SV_Move mins and maxs are relative if the entire move stays in a solid volume, trace.allsolid will be set if the starting point is in a solid, it will be allowed to move out to an open area nomonsters is used for line of sight or edge testing, where mosnters shouldn't be considered solid objects passedict is explicitly excluded from clipping checks (normally NULL)
public static Move ( Vector3 &start, Vector3 &mins, Vector3 &maxs, Vector3 &end, int type, edict_t passedict ) : trace_t
start Vector3
mins Vector3
maxs Vector3
end Vector3
type int
passedict edict_t
return trace_t

MoveStep() public static method

SV_movestep Called by monster program code. The move will be adjusted for slopes and stairs, but if the move isn't possible, no move is done, false is returned, and pr_global_struct.trace_normal is set to the normal of the blocking wall
public static MoveStep ( edict_t ent, v3f &move, bool relink ) : bool
ent edict_t
move v3f
relink bool
return bool

MoveToGoal() public static method

SV_MoveToGoal
public static MoveToGoal ( ) : void
return void

NumForEdict() public static method

NUM_FOR_EDICT
public static NumForEdict ( edict_t e ) : int
e edict_t
return int

Physics() public static method

SV_Physics
public static Physics ( ) : void
return void

PointContents() public static method

SV_PointContents
public static PointContents ( Vector3 &p ) : int
p Vector3
return int

ProgToEdict() public static method

PROG_TO_EDICT(e) Offset in bytes!
public static ProgToEdict ( int e ) : edict_t
e int
return edict_t

RecursiveHullCheck() public static method

SV_RecursiveHullCheck
public static RecursiveHullCheck ( hull_t hull, int num, float p1f, float p2f, Vector3 &p1, Vector3 &p2, trace_t trace ) : bool
hull hull_t
num int
p1f float
p2f float
p1 Vector3
p2 Vector3
trace trace_t
return bool

RunClients() public static method

SV_RunClients
public static RunClients ( ) : void
return void

SetIdealPitch() public static method

SV_SetIdealPitch
public static SetIdealPitch ( ) : void
return void

UnlinkEdict() public static method

SV_UnlinkEdict call before removing an entity, and before trying to move one, so it doesn't clip against itself flags ent->v.modified
public static UnlinkEdict ( edict_t ent ) : void
ent edict_t
return void