author | unc0rr |
Thu, 10 Dec 2015 00:33:45 +0300 | |
branch | qmlfrontend |
changeset 11450 | 0c75fa9ce340 |
parent 11449 | 2bf0491d5e88 |
child 11451 | 6e9b12864856 |
permissions | -rw-r--r-- |
10406 | 1 |
unit uFLTypes; |
10418
091d2c0216c3
Move away from passing shortstrings into C code, now IPC works
unc0rr
parents:
10406
diff
changeset
|
2 |
interface |
11450
0c75fa9ce340
- Use queues instead of single buffer to communicate between threads
unc0rr
parents:
11449
diff
changeset
|
3 |
uses SDLh; |
10406 | 4 |
|
11434 | 5 |
const |
6 |
MAXARGS = 32; |
|
7 |
||
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10420
diff
changeset
|
8 |
type |
11443 | 9 |
TMessageType = (mtRenderingPreview, mtPreview, mtAddPlayingTeam, mtRemovePlayingTeam |
10 |
, mtAddTeam, mtRemoveTeam, mtTeamColor, mtHedgehogsNumber, mtNetData |
|
11 |
, mtFlibEvent, mtConnected, mtDisconnected, mtAddLobbyClient |
|
11424 | 12 |
, mtRemoveLobbyClient, mtLobbyChatLine, mtAddRoomClient |
13 |
, mtRemoveRoomClient, mtRoomChatLine, mtAddRoom, mtUpdateRoom |
|
11430 | 14 |
, mtRemoveRoom, mtError, mtWarning, mtMoveToLobby, mtMoveToRoom |
11433 | 15 |
, mtNickname, mtSeed, mtTheme, mtScript, mtFeatureSize, mtMapGen |
11440 | 16 |
, mtMap, mtMazeSize, mtTemplate, mtAmmo, mtScheme); |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10420
diff
changeset
|
17 |
|
11434 | 18 |
TFLIBEvent = (flibGameFinished); |
19 |
||
11449 | 20 |
TClientFlag = (cfReady, cfRegistered, cfInRoom, cfContributor, cfInGame, cfRoomAdmin, cfServerAdmin); |
21 |
||
11450
0c75fa9ce340
- Use queues instead of single buffer to communicate between threads
unc0rr
parents:
11449
diff
changeset
|
22 |
PIPCMessage = ^TIPCMessage; |
10428
7c25297720f1
More refactoring: move PoC preview getting code into flib
unc0rr
parents:
10420
diff
changeset
|
23 |
TIPCMessage = record |
10418
091d2c0216c3
Move away from passing shortstrings into C code, now IPC works
unc0rr
parents:
10406
diff
changeset
|
24 |
str: shortstring; |
091d2c0216c3
Move away from passing shortstrings into C code, now IPC works
unc0rr
parents:
10406
diff
changeset
|
25 |
len: Longword; |
11450
0c75fa9ce340
- Use queues instead of single buffer to communicate between threads
unc0rr
parents:
11449
diff
changeset
|
26 |
buf: Pointer; |
0c75fa9ce340
- Use queues instead of single buffer to communicate between threads
unc0rr
parents:
11449
diff
changeset
|
27 |
next: PIPCMessage; |
0c75fa9ce340
- Use queues instead of single buffer to communicate between threads
unc0rr
parents:
11449
diff
changeset
|
28 |
end; |
0c75fa9ce340
- Use queues instead of single buffer to communicate between threads
unc0rr
parents:
11449
diff
changeset
|
29 |
PIPCQueue = ^TIPCQueue; |
0c75fa9ce340
- Use queues instead of single buffer to communicate between threads
unc0rr
parents:
11449
diff
changeset
|
30 |
TIPCQueue = record |
0c75fa9ce340
- Use queues instead of single buffer to communicate between threads
unc0rr
parents:
11449
diff
changeset
|
31 |
msg: TIPCMessage; |
0c75fa9ce340
- Use queues instead of single buffer to communicate between threads
unc0rr
parents:
11449
diff
changeset
|
32 |
mut: PSDL_Mutex; |
0c75fa9ce340
- Use queues instead of single buffer to communicate between threads
unc0rr
parents:
11449
diff
changeset
|
33 |
cond: PSDL_Cond; |
0c75fa9ce340
- Use queues instead of single buffer to communicate between threads
unc0rr
parents:
11449
diff
changeset
|
34 |
last: PIPCMessage; |
10418
091d2c0216c3
Move away from passing shortstrings into C code, now IPC works
unc0rr
parents:
10406
diff
changeset
|
35 |
end; |
10432 | 36 |
|
10420 | 37 |
TIPCCallback = procedure (p: pointer; msg: PChar; len: Longword); |
10951
89a7f617e091
- Move protocol handling events to main thread through qt's main loop
unc0rr
parents:
10892
diff
changeset
|
38 |
TUICallback = procedure (p: pointer; msgType: TMessageType; msg: PChar; len: Longword); cdecl; |
10406 | 39 |
|
10432 | 40 |
TGameType = (gtPreview, gtLocal); |
41 |
THedgehog = record |
|
42 |
name: shortstring; |
|
43 |
hat: shortstring; |
|
44 |
end; |
|
45 |
TTeam = record |
|
11442 | 46 |
teamName |
47 |
, flag |
|
48 |
, grave |
|
49 |
, fort |
|
50 |
, voice |
|
51 |
, owner: shortstring; |
|
10450 | 52 |
color: Longword; |
10432 | 53 |
extDriven: boolean; |
54 |
botLevel: Longword; |
|
55 |
hedgehogs: array[0..7] of THedgehog; |
|
56 |
hogsNumber: Longword; |
|
10440 | 57 |
end; |
58 |
PTeam = ^TTeam; |
|
10432 | 59 |
|
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
60 |
TScheme = record |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
61 |
schemeName |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
62 |
, scriptparam : shortstring; |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
63 |
fortsmode |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
64 |
, divteams |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
65 |
, solidland |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
66 |
, border |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
67 |
, lowgrav |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
68 |
, laser |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
69 |
, invulnerability |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
70 |
, mines |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
71 |
, vampiric |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
72 |
, karma |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
73 |
, artillery |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
74 |
, randomorder |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
75 |
, king |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
76 |
, placehog |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
77 |
, sharedammo |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
78 |
, disablegirders |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
79 |
, disablewind |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
80 |
, morewind |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
81 |
, tagteam |
11440 | 82 |
, resethealth |
83 |
, disablelandobjects |
|
84 |
, aisurvival |
|
85 |
, infattack |
|
86 |
, resetweps |
|
87 |
, perhogammo |
|
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
88 |
, bottomborder: boolean; |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
89 |
damagefactor |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
90 |
, turntime |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
91 |
, health |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
92 |
, suddendeath |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
93 |
, caseprobability |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
94 |
, minestime |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
95 |
, landadds |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
96 |
, minedudpct |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
97 |
, explosives |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
98 |
, minesnum |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
99 |
, healthprobability |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
100 |
, healthcaseamount |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
101 |
, waterrise |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
102 |
, healthdecrease |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
103 |
, ropepct |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
104 |
, getawaytime |
11440 | 105 |
, airmines |
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
106 |
, worldedge: LongInt |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
107 |
end; |
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
108 |
PScheme = ^TScheme; |
10888 | 109 |
TAmmo = record |
110 |
ammoName: shortstring; |
|
10892 | 111 |
a, b, c, d: shortstring; |
10888 | 112 |
end; |
113 |
PAmmo = ^TAmmo; |
|
10819
57e21f7621b0
Send selected scheme config on engine initialization (WIP)
unc0rr
parents:
10452
diff
changeset
|
114 |
|
11434 | 115 |
PGameConfig = ^TGameConfig; |
116 |
TGameConfig = record |
|
117 |
seed: shortstring; |
|
118 |
theme: shortstring; |
|
119 |
script: shortstring; |
|
120 |
map: shortstring; |
|
121 |
scheme: TScheme; |
|
122 |
ammo: TAmmo; |
|
123 |
mapgen: LongInt; |
|
124 |
featureSize: LongInt; |
|
125 |
mazesize: LongInt; |
|
126 |
template: LongInt; |
|
127 |
gameType: TGameType; |
|
128 |
teams: array[0..7] of TTeam; |
|
129 |
arguments: array[0..Pred(MAXARGS)] of shortstring; |
|
130 |
argv: array[0..Pred(MAXARGS)] of PChar; |
|
131 |
argumentsNumber: Longword; |
|
132 |
nextConfig: PGameConfig; |
|
133 |
end; |
|
134 |
||
10406 | 135 |
implementation |
136 |
||
137 |
end. |