Skip to content

Commit 01649a7

Browse files
committed
feat: game stream ids
1 parent 8d93f66 commit 01649a7

File tree

1 file changed

+148
-60
lines changed

1 file changed

+148
-60
lines changed
+148-60
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,111 @@
1-
export interface GameStreamId {
1+
/**
2+
* The DragonRealms default game streams.
3+
* When the game socket sends data, it may be tagged with a stream id.
4+
* The stream id indicates which game "window" the data is intended for.
5+
* User-defined scripts may also output to custom streams, which
6+
* aren't represented here but which Phoenix will support.
7+
*/
8+
export enum GameStreamId {
29
/**
3-
* User-friendly title for the game stream.
4-
* Example: 'Spells' or 'Main'.
10+
* The main story window. This is where most game output goes.
11+
* This content is unique in that there is no stream id for it.
12+
*/
13+
MAIN = '',
14+
/**
15+
* When the game sends periodic experience updates.
16+
*/
17+
EXPERIENCE = 'experience',
18+
/**
19+
* When the game sends periodic room updates.
20+
* Usually updated when you move rooms or when people enter/leave.
21+
*/
22+
ROOM = 'room',
23+
/**
24+
* Displays what spells/abilities are active and their duration.
25+
*/
26+
SPELLS = 'percWindow',
27+
/**
28+
* Lists inventory in the main container on your character.
29+
*/
30+
INVENTORY = 'inv',
31+
/**
32+
* For Warrior Mages and characters who have magical pets.
33+
* This lets the player see what their familiar sees and does.
34+
* It might also be used by Empaths when perceiving wounds.
35+
*/
36+
FAMILIAR = 'familiar',
37+
/**
38+
* Messages sent and received via gweths and other ESP items.
39+
*/
40+
THOUGHTS = 'thoughts',
41+
/**
42+
* Most combat messages.
43+
*/
44+
COMBAT = 'combat',
45+
/**
46+
* Output when you run the `ASSESS` verb.
47+
*/
48+
ASSESS = 'assess',
49+
/**
50+
* The stream id is 'logons' but in game you toggle on/off for arrivals.
51+
* Only for characters who opt-in to disclose their logons.
552
*/
6-
title: string;
53+
ARRIVALS = 'logons',
54+
/**
55+
* Messages when characters die.
56+
* Only for characters who opt-in to disclose their deaths.
57+
*/
58+
DEATHS = 'deaths',
59+
/**
60+
* Periodic messaging from items with atmospheric effects.
61+
*/
62+
ATMOSPHERICS = 'atmospherics',
63+
/**
64+
* Similar to `THOUGHTS` but for game-wide chat for beginners.
65+
*/
66+
CHATTER = 'chatter',
67+
/**
68+
* No idea.
69+
*/
70+
CONVERSATION = 'conversation',
71+
/**
72+
* When players send and receive whispers via `WHISPER` verb.
73+
*/
74+
WHISPERS = 'whispers',
75+
/**
76+
* No idea.
77+
*/
78+
TALK = 'talk',
79+
/**
80+
* When players send and receive messages via `OOC` verb.
81+
*/
82+
OOC = 'ooc',
83+
/**
84+
* No idea. Maybe things that happen when a character is in a group?
85+
*/
86+
GROUP = 'group',
87+
}
788

89+
export interface GameStreamItemInfo {
890
/**
991
* Unique identifier for the game stream.
1092
* Assigned by DragonRealms.
1193
* Example: 'percWindow' (spells) or '' (main).
1294
*/
13-
streamId: string;
95+
streamId: GameStreamId;
1496

1597
/**
1698
* Unique identifier for the stream for our purposes.
1799
* Generally is the same value as the `streamId` except
18100
* for the main stream which is 'main' instead of empty string.
19101
*/
20102
itemId: string;
103+
104+
/**
105+
* User-friendly title for the game stream.
106+
* Example: 'Spells' or 'Main'.
107+
*/
108+
itemTitle: string;
21109
}
22110

23111
/**
@@ -28,95 +116,95 @@ export interface GameStreamId {
28116
*
29117
* This array is the default set of streams that we know DragonRealms supports.
30118
*/
31-
export const DefaultGameStreamIds: Array<GameStreamId> = [
119+
export const DefaultGameStreamItemInfos: Array<GameStreamItemInfo> = [
32120
{
33-
title: 'Main',
34-
streamId: '',
35-
itemId: 'main',
121+
streamId: GameStreamId.MAIN, // special case, it's an empty string
122+
itemId: 'main', // special case since the stream id is empty text
123+
itemTitle: 'Main',
36124
},
37125
{
38-
title: 'Experience',
39-
streamId: 'experience',
40-
itemId: 'experience',
126+
streamId: GameStreamId.EXPERIENCE,
127+
itemId: GameStreamId.EXPERIENCE,
128+
itemTitle: 'Experience',
41129
},
42130
{
43-
title: 'Room',
44-
streamId: 'room',
45-
itemId: 'room',
131+
streamId: GameStreamId.ROOM,
132+
itemId: GameStreamId.ROOM,
133+
itemTitle: 'Room',
46134
},
47135
{
48-
title: 'Spells',
49-
streamId: 'percWindow',
50-
itemId: 'percWindow',
136+
streamId: GameStreamId.SPELLS,
137+
itemId: GameStreamId.SPELLS,
138+
itemTitle: 'Spells',
51139
},
52140
{
53-
title: 'Inventory',
54-
streamId: 'inv',
55-
itemId: 'inv',
141+
streamId: GameStreamId.INVENTORY,
142+
itemId: GameStreamId.INVENTORY,
143+
itemTitle: 'Inventory',
56144
},
57145
{
58-
title: 'Familiar',
59-
streamId: 'familiar',
60-
itemId: 'familiar',
146+
streamId: GameStreamId.FAMILIAR,
147+
itemId: GameStreamId.FAMILIAR,
148+
itemTitle: 'Familiar',
61149
},
62150
{
63-
title: 'Thoughts',
64-
streamId: 'thoughts',
65-
itemId: 'thoughts',
151+
streamId: GameStreamId.THOUGHTS,
152+
itemId: GameStreamId.THOUGHTS,
153+
itemTitle: 'Thoughts',
66154
},
67155
{
68-
title: 'Combat',
69-
streamId: 'combat',
70-
itemId: 'combat',
156+
streamId: GameStreamId.COMBAT,
157+
itemId: GameStreamId.COMBAT,
158+
itemTitle: 'Combat',
71159
},
72160
{
73-
title: 'Assess',
74-
streamId: 'assess',
75-
itemId: 'assess',
161+
streamId: GameStreamId.ASSESS,
162+
itemId: GameStreamId.ASSESS,
163+
itemTitle: 'Assess',
76164
},
77165
{
78-
title: 'Arrivals',
79-
streamId: 'logons',
80-
itemId: 'logons',
166+
streamId: GameStreamId.ARRIVALS,
167+
itemId: GameStreamId.ARRIVALS,
168+
itemTitle: 'Arrivals',
81169
},
82170
{
83-
title: 'Deaths',
84-
streamId: 'deaths',
85-
itemId: 'deaths',
171+
streamId: GameStreamId.DEATHS,
172+
itemId: GameStreamId.DEATHS,
173+
itemTitle: 'Deaths',
86174
},
87175
{
88-
title: 'Atmospherics',
89-
streamId: 'atmospherics',
90-
itemId: 'atmospherics',
176+
streamId: GameStreamId.ATMOSPHERICS,
177+
itemId: GameStreamId.ATMOSPHERICS,
178+
itemTitle: 'Atmospherics',
91179
},
92180
{
93-
title: 'Chatter',
94-
streamId: 'chatter',
95-
itemId: 'chatter',
181+
streamId: GameStreamId.CHATTER,
182+
itemId: GameStreamId.CHATTER,
183+
itemTitle: 'Chatter',
96184
},
97185
{
98-
title: 'Conversation',
99-
streamId: 'conversation',
100-
itemId: 'conversation',
186+
streamId: GameStreamId.CONVERSATION,
187+
itemId: GameStreamId.CONVERSATION,
188+
itemTitle: 'Conversation',
101189
},
102190
{
103-
title: 'Whispers',
104-
streamId: 'whispers',
105-
itemId: 'whispers',
191+
streamId: GameStreamId.WHISPERS,
192+
itemId: GameStreamId.WHISPERS,
193+
itemTitle: 'Whispers',
106194
},
107195
{
108-
title: 'Talk',
109-
streamId: 'talk',
110-
itemId: 'talk',
196+
streamId: GameStreamId.TALK,
197+
itemId: GameStreamId.TALK,
198+
itemTitle: 'Talk',
111199
},
112200
{
113-
title: 'OOC',
114-
streamId: 'ooc',
115-
itemId: 'ooc',
201+
streamId: GameStreamId.OOC,
202+
itemId: GameStreamId.OOC,
203+
itemTitle: 'OOC',
116204
},
117205
{
118-
title: 'Group',
119-
streamId: 'group',
120-
itemId: 'group',
206+
streamId: GameStreamId.GROUP,
207+
itemId: GameStreamId.GROUP,
208+
itemTitle: 'Group',
121209
},
122210
];

0 commit comments

Comments
 (0)