The vocabulary of the upstream
havenclient: the terms its own code uses, each anchored to the class that defines it. The addon layer’s own terms are deliberately absent — they are defined bysrc/io/brodgar/and by the AddOn documentation, and a third copy is the one that goes stale.
dolda2000/hafen-client, the open-source Haven & Hearth client
this project forks.Gob. Identified by a long id and
positioned at a Coord2d rc.OCache: the live set of gobs,
iterable, keyed by id. The primary world read surface.GAttrib: a typed component
attached to a gob (e.g. Drawable, Moving, GobHealth). Read via gob.getattr(Class).GAttrib that carries a gob’s visual resource; getres().name is the gob’s
identity string (e.g. gfx/kritter/rabbit/rabbit; gfx/borka/body = a player).MCache: terrain tiles, heights,
overlays, organized into grids.11×11 world-unit cell (MCache.tilesz); a grid is
100×100 tiles (MCache.cmaps) with a global grid id (MCache.Grid.id, identical for all
players); grids group into segments (MapFile.Segment) whose ids are local per player.Gob.rc is
login/session-relative (starts ~(-10,-10) tiles), not global and not comparable between
players. The only shareable anchor is grid id + within-grid offset; segment ids are local.Coord is an integer coordinate (tiles, pixels); Coord2d is a double
world coordinate. Gob.rc is a Coord2d. Server “click” coords are Coord2d.floor(posres)
where posres = 11/1024 per unit.Glob: holds oc (OCache),
map (MCache), party, ast (astronomy/time), character attributes (cattr), weather/light.
Reached via ui.sess.glob.GameUI (GameUI(String chrid, long plid, String genus)). Prefixes the
map file’s name (GameUI.mapfilename()).GameUI.MapView.plgob is the live
gob id; MapView.player() returns the player’s Gob. GameUI.plid carries the
same number, and arrives first and needs no tree walk: both come from their own
widget’s creation args, the GameUI widget lands before its MapView is parented,
and plid is final on a widget a session can be asked for directly. It is what
Sessions.Member.check reads to find a member’s own gob in another session’s OCache.Widget. The whole UI is a tree of
widgets rooted at RootWidget (id 0).UI: owns the widget-id map, dispatches
input, and routes server↔client widget messages. Its monitor (synchronized(ui)) serializes
tree mutation.GameUI: holds map, menu, maininv,
equwnd, chrwdg, chat, opts, belt (the action bar), etc., and places server widgets via
addchild.Widget.wdgmsg(String, Object...). The universal action channel.Widget.uimsg(String, Object...). How the server updates a widget
(e.g. item count, tooltip).Widget.RName +
Widget.Factory. Server widget type strings ("inv", "wnd",
"scm", …) resolve to factories via Widget.gettype3 using the
package-private Widget.types map — the widget-replacement seam.UI.bind / getwidget / widgetid.
A widget must be bound to a server id to send/receive server messages.MenuGrid (@RName("scm")).
Actions are paginae; invoked via wdgmsg("act", path...) or GameUI.act(...).FlowerMenu
(@RName("sm")). A choice is a petal; selected via wdgmsg("cl", num).GItem is the server-side item widget (fields num and
meter, plus tooltip info); WItem is its visible cell inside an
Inventory, and the one that draws both icon numbers — from info() as much as
from those two fields (see state.md).ItemInfo; ItemInfo.Name
is the display name. Some info (quality) is server-shipped resource code, not a plain field.GOut, passed to Widget.draw:
image/text/rect/line/prect/….KeyBinding;
KeyBinding.get(id, default) interns a binding persisted under keybind/<id>.Session is the connected game session;
RemoteUI is the in-game runner that pumps server messages into the
UI. RemoteUI.init(ui) is where ui.sess is bound.RMessage):
RMSG_NEWWDG, RMSG_WDGMSG, RMSG_ADDWDG, RMSG_DSTWDG, RMSG_GLOBLOB, …UI.CommandQueue: server widget operations are deferred
and dependency-ordered, executed on Loader threads under synchronized(ui).haven.Loading) thrown when a resource/gob/grid isn’t ready yet; the
caller retries when it resolves. Any code touching resources or gobs must tolerate it.