QuakeServer.Models (quake_server v0.1.0)

Copy Markdown View Source

The models a level has asked for, by index, as the server needs them: their box, and for brush models the hulls things collide with.

QuakeServer.Models.info(server, "*3")
#=> %{name: "*3", kind: :brush, mins:, maxs:, hulls: [...]}

A client program's world shares its server's model list (share/2): the server's models keep the server's indexes, and a model only the client asks for gets an index below zero, -1 first. The client's own names are kept in the host's ext.own_models.

Summary

Functions

The model of index index, or nil.

The index of model name, or nil when it was never registered.

What the server needs of model name: a world submodel *n, or a model file.

The name of model index, "" when there is none.

Register model name (a precache), returning its index.

Register sound name, returning the server.

Take the server's model list names (index 0 the empty name) as this client world's: each model is loaded at the server's index, and models this world asks for that the server lacks are numbered below zero from here on.

Functions

get(server, index)

@spec get(QuakeServer.Server.t(), integer()) :: map() | nil

The model of index index, or nil.

index(server, name)

@spec index(QuakeServer.Server.t(), String.t()) :: integer() | nil

The index of model name, or nil when it was never registered.

info(server, name)

@spec info(QuakeServer.Server.t(), String.t()) :: map()

What the server needs of model name: a world submodel *n, or a model file.

name(server, index)

@spec name(QuakeServer.Server.t(), integer()) :: String.t()

The name of model index, "" when there is none.

precache(server, name)

Register model name (a precache), returning its index.

precache_sound(server, name)

@spec precache_sound(QuakeServer.Server.t(), String.t()) :: QuakeServer.Server.t()

Register sound name, returning the server.

share(server, names)

Take the server's model list names (index 0 the empty name) as this client world's: each model is loaded at the server's index, and models this world asks for that the server lacks are numbered below zero from here on.