vcr_replay

advertisement
ENUMS
enum EventClass
ECLASS_LOC = 0,
ECLASS_VFX,
ECLASS_SFX,
ECLASS_SYS,
ECLASS_COMM,
ECLASS_OTHER,
ECLASS_MAXIMUM
enum EventType
ETYPE_NOTYPE
= 63,
// doesn't need to be anything in particular, but this is
the number least likely to be used for a real event type
// ECLASS_LOC events
ETYPE_CONE
= 0,
// cone state
ETYPE_POST
= 1,
// post state
ETYPE_SIGN
= 2,
// sign state
ETYPE_WHEEL
= 3,
// wheel state
ETYPE_WING
= 4,
// wing state
ETYPE_PART
= 5,
// part state
// note: do not change order of the ETYPE_*LOC events!
ETYPE_ZIPUPDATE = 6,
// tells server that last zip can be safely extrapolated
ETYPE_ZIPLOC_R
= 7,
// compressed vehicle loc (more detailed than
SIMPLELOC)
ETYPE_ZIPLOC_N
= 8,
// compressed vehicle loc
ETYPE_ZIPLOC_1
= 9,
// compressed vehicle loc
ETYPE_ZIPLOC_2
= 10,
// compressed vehicle loc
ETYPE_ZIPLOC_3
= 11,
// compressed vehicle loc
ETYPE_ZIPLOC_4
= 12,
// compressed vehicle loc
ETYPE_ZIPLOC_5
= 13,
// compressed vehicle loc
ETYPE_ZIPLOC_6
= 14,
// compressed vehicle loc
ETYPE_ZIPLOC_7
= 15,
// compressed vehicle loc
ETYPE_SIMPLELOC_00 = 16, // simplified location event (smaller than ZIPLOC)
ETYPE_SIMPLELOC_01 = 17, // simplified location event
ETYPE_SIMPLELOC_02 = 18,
// simplified location event
ETYPE_SIMPLELOC_03 = 19, // simplified location event
ETYPE_SIMPLELOC_04 = 20, // simplified location event
ETYPE_SIMPLELOC_05 = 21, // simplified location event
ETYPE_SIMPLELOC_06 = 22,
// simplified location event
ETYPE_SIMPLELOC_07 = 23, // simplified location event
ETYPE_SIMPLELOC_08 = 24, // simplified location event
ETYPE_SIMPLELOC_09
ETYPE_SIMPLELOC_10
ETYPE_SIMPLELOC_11
ETYPE_SIMPLELOC_12
ETYPE_SIMPLELOC_13
ETYPE_SIMPLELOC_14
ETYPE_SIMPLELOC_15
ETYPE_SIMPLELOC_16
ETYPE_SIMPLELOC_17
ETYPE_SIMPLELOC_18
ETYPE_SIMPLELOC_19
ETYPE_SIMPLELOC_20
ETYPE_SIMPLELOC_21
ETYPE_SIMPLELOC_22
ETYPE_SIMPLELOC_23
ETYPE_SIMPLELOC_24
ETYPE_SIMPLELOC_25
ETYPE_SIMPLELOC_26
ETYPE_SIMPLELOC_27
ETYPE_SIMPLELOC_28
ETYPE_SIMPLELOC_29
ETYPE_SIMPLELOC_30
ETYPE_SIMPLELOC_31
ETYPE_SIMPLELOC_32
= 25,
= 26,
= 27,
= 28,
= 29,
= 30,
= 31,
= 32,
= 33,
= 34,
= 35,
= 36,
= 37,
= 38,
= 39,
= 40,
= 41,
= 42,
= 43,
= 44,
= 45,
= 46,
= 47,
= 48,
// ECLASS_VFX events
ETYPE_BACKFIRE
= 0,
ETYPE_LIGHT
= 1,
ETYPE_TERRAIN
= 2,
ETYPE_COPTER
= 3,
ETYPE_WEATHER
= 4,
ETYPE_CLOUDMAP
= 5,
ETYPE_LIGHTNING = 6,
ETYPE_DENT_BODY = 7,
ETYPE_RESET_BODY = 8,
ETYPE_WALLSKID
= 9,
ETYPE_RACELIGHTS = 10,
caution lights around track?
// ECLASS_SFX events
ETYPE_VEHSFX_START = 0,
ETYPE_THUNDER
= 1,
ETYPE_PIT_HORN
= 2,
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// simplified location event
// veh backfire animation
// veh rain light switch
// terrain conditions event
// sends the helicopter on its way
// weather updates from the server
// cloud texture map names
// lightning
// dent bodywork
// reset bodywork (vehicle reset to pits or something)
// generate skid on wall
// start lights, pit entrance & exit lights, maybe
// starts a vehicle sound effect
// thunder
// pit horn plays when someone enters pits
ECLASS_SYS events
ETYPE_SYNC_NOTIFY = 0,
// server sends this to client if client should send a
sync request (state change, etc)
ETYPE_PLAYER_READY = 1,
// message from client to server requesting
verification
ETYPE_PLAYER_VERIFY = 2,
// server to client, data verify along with any
changes
ETYPE_TRACKTOLOAD = 3,
// server to client, new track is being loaded
ETYPE_CHATMSG
= 4,
// chat message, bi-directional
ETYPE_SCOREBOARD = 5,
// score update
ETYPE_CHECKPOINT = 6,
ETYPE_SPEEDCOMP = 7,
ETYPE_NEWSTATIONS = 8,
// complete new list of all active flag stations
ETYPE_UPDATESTATIONS = 9,
// update flag stations
ETYPE_COUNTDOWN = 10,
ETYPE_NEXTPHASE = 11,
ETYPE_SKIPFORMATION = 12,
// start countdown
// move to next phase
// skip formation lap
ETYPE_YELLOW_FLAG = 13,
ETYPE_STOP_GO
= 14,
ETYPE_SERVE_STOP_GO = 15,
// received stop/go
// served stop/go
ETYPE_DNF
= 16,
ETYPE_UNDO_DNF
= 17,
ETYPE_DISQUALIFY = 18,
ETYPE_CLIENTKICK = 19,
ETYPE_PIT_BLUE_ON = 20,
ETYPE_PIT_BLUE_OFF = 21,
// DNF player
// Undo DNF
// used to kick client
// pit exit flashing blue
// pit exit not flashing blue
ETYPE_TRACK_ORDER = 24,
// order of vehicles on track (while under yellow
flag)
ETYPE_SAFETY_CAR_ON = 25,
// safety car is active
ETYPE_SAFETY_CAR_OFF = 26, // safety car is not active
ETYPE_SAFETY_CAR_LAPS = 27, // set the number of safety car formation laps
ETYPE_NEW_ENGINE
= 28,
ETYPE_QUAL_ORDER
= 29,
ETYPE_TORDER_ADD
= 30,
ETYPE_TORDER_REMOVE = 31,
// slot needed new engine during warmup (so send
to back of grid)
// listing of new qualifying order (used when player
// client -> server msg, if client is added from
track order
// client -> server msg, if client is removed from
track order
ETYPE_TORDER_TOBACK = 32,
ETYPE_TRACK_CLOSED = 33,
ETYPE_TRACK_OPENED = 34,
ETYPE_ENTRY_DATA = 35,
ETYPE_ENTRY_DATA_OK = 36,
ETYPE_ENTRY_DATA_NO = 37,
// client -> server msg, if client is removed from
track order
// server -> client msg, track has been closed for
business
// server -> client msg, track has been opened for
business
// client -> server, client is sending entry data
// server -> client, entry data is ok
// server -> client, entry data not allowed
ETYPE_DRIVER_CHANGE = 38,
// sent from previous driver to new driver
(through server if necessary)
ETYPE_DRIVER_CHANGE_NOTIFY = 39, // sent from previous driver to new
driver (through server if necessary)
ETYPE_PASSENGER_CHANGE = 40, // notifies drivers that a passenger has
joined/left their vehicle
ETYPE_FILE_REQUEST = 41,
ETYPE_FILE_HEADER = 42,
ETYPE_NET_AI_INFO = 43,
// server info about one multiplayer AI
ETYPE_NET_AI_REQUEST = 44, // request server info about one or more AIs
ETYPE_NET_RESTART = 45,
// restart event or race in multiplayer
ETYPE_CLIENT_VIEW = 46, // what client is looking at (slot or actual position)
for server throttling purposes
ETYPE_VOICE_CHAT_MIXED
= 47,
ETYPE_VOICE_CHAT_CLIENT = 48,
// ECLASS_OTHER events
ETYPE_FIX
= 0,
ETYPE_PITSTATE
= 1,
ETYPE_BASICSCORE
= 2,
ETYPE_BASICSCORECLIENT
= 3,
ETYPE_SIMULATEINTERNET
= 4,
// voice chat data thats been mixed by the
server and ready for client consumption
// voice chat data that the clients are
submitting to the server
// fix damage
// change in pitstate
// basic score
// basic score client
// simulate some attributes of the Internet
for network testing purposes
ETYPE_CALLVOTE_NEXTSESSION = 5, // "/callvote nextsession"
ETYPE_CALLVOTE_NEXTEVENT
= 6, // "/callvote nextrace"
ETYPE_CALLVOTE_ADDAI
= 7,
// "/callvote addai"
ETYPE_CALLVOTE_ADD5AI
= 8,
// "/callvote add5ai"
ETYPE_CALLVOTE_REMOTESERVER = 9, // "/callvote kingme"
ETYPE_CALLVOTE_RESTARTEVENT = 10, // "/callvote restartweekend"
ETYPE_CALLVOTE_RESTARTRACE = 11, // "/callvote restartrace"
ETYPE_VOTE_YES
= 12, // "/vote yes"
ETYPE_VOTE_NO
= 13, // "/vote no"
ETYPE_VOTEIGNORED_PARTICIPANT = 14, // "Vote ignored: Only active
participants may vote"
ETYPE_VOTEIGNORED_NOVOTE
= 15, // "Vote ignored: There is no vote in
progress"
ETYPE_VOTEIGNORED_ONEVOTE = 16, // "Vote ignored: You can only vote
once per issue"
ETYPE_NODE_VOTED_YES
= 17, // "%s voted YES to %s:" plus either "%d
more to pass" or "vote PASSED"
ETYPE_NODE_VOTED_NO
= 18, // "%s voted NO to %s"
ETYPE_CANNOTCALL_DISABLED = 19, // "Cannot call vote: voting for %s is
disabled"
ETYPE_CANNOTCALL_INPROGRESS = 20, // "Cannot call vote: there is a vote in
progress"
ETYPE_CANNOTCALL_JUSTENDED = 21, // "Cannot call vote: voted just ended
(wait %d seconds)"
ETYPE_CANNOTCALL_PARTICIPANT = 22, // "Cannot call vote: must be server
or active participant"
ETYPE_CANNOTCALL_BEFORERACE = 23, // "Cannot call vote: cannot restart
race before race starts"
ETYPE_CANNOTCALL_PASTRACE = 24, // "Cannot call vote: cannot advance
session past race"
ETYPE_CANNOTCALL_MINVOTERS = 25, // "Cannot call vote: %d voters
required"
ETYPE_CANNOTCALL_RACERESTARTS = 26, // "Cannot call vote: no more race
restarts allowed"
ETYPE_CANNOTCALL_MOREAI
= 27, // "Cannot call vote: no more AIs can be
added"
ETYPE_VOTE_PROPOSED
= 28, // "\"%s\" proposed by %s:" plus either "%d
vote(s) needed to pass" or "vote
PASSED"
ETYPE_WITHHOLDING_GREEN
= 29, // WITHHOLDING_GREEN_MSG
defined in steward.hpp
ETYPE_CANNOTCALL_PLRNOTFOUND = 31, // "Cannot call vote: player
specified not found"
ETYPE_ADMIN_MSG
= 32, // Some admin message
ETYPE_CANNOTCALL_SPECEVENT = 33, // "Cannot call vote: circuit not found
or request disallowed"
enum EventFlag // Event flag
EFLAG_NONE = 0,
EFLAG_NO_NETWORK,
EFLAG_HIGH_PRIO,
guaranteed)
EFLAG_GUARANTEE,
EFLAG_MAXIMUM
// no special flags (default)
// do not send across network (i.e. replay only)
// make sure it's in the high priority list (but not
// guaranteed network event
enum FileRequestType
FREQ_PARTIAL=0, //request has full partial path
FREQ_FULLPATH, //request has full path
FREQ_SYMBOLIC //request is a symbol so the server needs to do a table lookup
// Invalid owner definition
#define EOWNER_INVALID
(0x0ff)
Event data packets (used for network and playback)
struct ZipLoc, data for compressed body and tire locations
// Used Bits in mInfo1:
// xxxxxxxx xxxxxx00 00000000 00000000 - current RPS
(14 bits)
// 00000000 000000x0 00000000 00000000 - in pit lane flag (1 bit)
// 00000000 0000000x xxxx0000 00000000 - throttle
(5 bits)
// 00000000 00000000 0000x000 00000000 - brake light flag (1 bit)
// 00000000 00000000 00000x00 00000000 - horn
(1 bit)
// 00000000 00000000 000000xx 00000000 - traction control level (2 bits)
// 00000000 00000000 00000000 x0000000 - speed limiter (1 bit)
// 00000000 00000000 00000000 0xxxxxxx - steer yaw
(7 bits)
// Used Bits in mInfo2:
// xxxxxxxx 00000000 00000000 00000000 - acceleration (see below)
// 00000000 x0000000 00000000 00000000 - <NOT USED>
// 00000000 0x000000 00000000 00000000 - warning light flag
// 00000000 00x00000 00000000 00000000 - driver visible flag
// 00000000 000x0000 00000000 00000000 - head light flag
// 00000000 0000xx00 00000000 00000000 - current driver (2 bits)
// 00000000 000000x0 00000000 00000000 - detachable Part Damage State
(DPART_DEBRIS11)
// 00000000 0000000x 00000000 00000000 - detachable Part Damage State
(DPART_DEBRIS10)
// 00000000 00000000 x0000000 00000000 - detachable Part Damage State
(DPART_DEBRIS9)
// 00000000 00000000 0x000000 00000000 - detachable Part Damage State
(DPART_DEBRIS8)
// 00000000 00000000 00x00000 00000000 - detachable Part Damage State
(DPART_DEBRIS7)
// 00000000 00000000 000x0000 00000000 - detachable Part Damage State
(DPART_DEBRIS6)
// 00000000 00000000 0000x000 00000000 - detachable Part Damage State
(DPART_DEBRIS5)
// 00000000 00000000 00000x00 00000000 - detachable Part Damage State
(DPART_DEBRIS4)
// 00000000 00000000 000000x0 00000000 - detachable Part Damage State
(DPART_DEBRIS3)
// 00000000 00000000 0000000x 00000000 - detachable Part Damage State
(DPART_DEBRIS2)
// 00000000 00000000 00000000 x0000000 - detachable Part Damage State
(DPART_DEBRIS1)
// 00000000 00000000 00000000 0x000000 - detachable Part Damage State
(DPART_DEBRIS0)
// 00000000 00000000 00000000 00x00000 - detachable Part Damage State
(DPART_RWING)
// 00000000 00000000 00000000 000x0000 - detachable Part Damage State
(DPART_FWING)
// 00000000 00000000 00000000 0000x000 - detachable Part Damage State
(DPART_RR)
// 00000000 00000000 00000000 00000x00 - detachable Part Damage State
(DPART_RL)
// 00000000 00000000 00000000 000000x0 - detachable Part Damage State
(DPART_FR)
// 00000000 00000000 00000000 0000000x - detachable Part Damage State
(DPART_FL)
Event Class
ZipLoc
zip;
// normal positional event
SimpleLoc
loc;
// extremely simplified positional event
LooseObjectEvent looseobject;
TerrainEvent
terr;
DentEvent
dent;
WallSkidEvent wallskid;
VFXEvent
vfx;
VFXEventX
xvfx;
TinyEvent
tiny;
ParticleEvent particle;
SFXEvent
sfx;
SysEvent
sys;
SyncNotify
syncNotify;
SyncEvent
sync;
ChatMessage
chat;
WeatherEvent
weather;
TrackEvent
track;
CountdownEvent countdown;
NextPhaseEvent nextphase;
ScoreEvent
score;
TrackOrderEvent trackOrder;
StationEvent
station;
SpdCmpEvent
spdcmp;
CPointEvent
cpoint;
SignPostEvent signpost;
PingEvent
ping;
BeginEvent
begin;
AddPlayerEvent addPlayer;
KickUserEvent kick;
PlayerVerifyData verify;
ClientEntryData entryData;
YellowFlagEvent yellow;
DriverChangeEvent newDriver;
DriverChangeNotify nextDriver;
PassengerChangeEvent passengerChange;
BasicScore
basicScore;
BasicScoreClient basicScoreClient;
FileRequest
fileRequest;
FileHeader
fileHeader;
MultiplayerAI mAI;
MultiplayerAIRequest mAIRequest;
ClientView
mClientView;
RaceLightEvent mRaceLight;
SimulateInternet mInternet;
VoiceEvent
mVoice;
// just a debugging tool
Fast inline functions to retrieve header information
EventClass GetClass() const { return (EventClass) ( mPack >> 29
); }
EventFlag GetFlag()
const { return (EventFlag) ((mPack >> 27) & 0x03 ); }
GameSession GetSession() const { return (GameSession)((mPack >> 24) & 0x07 ); }
EventType GetType()
const { return (EventType) ((mPack >> 18) & 0x03f ); }
long GetSize()
const { return
((mPack >> 8 ) & 0x03ff); }
long GetOwner()
const { return
( mPack
& 0x0ff ); }
float GetTime()
const { return
( mTime
); }
Struct ReplayParticipant , used to track participants
throughout the course of a race.
basic participant information
unsigned char mSlot;
// participant slot
char
mName1[32]; // name of primary driver
char
mName2[32]; // name of co-driver if any
char
mVehFile[32]; // name of the participants vehicle file
char
mSkinFile[32]; // name of the participants vehicle skin
unsigned char mUpgradePack[8]; // packed upgrade list
float
mEntryTime; // game ET of participants first appearance
float
mExitTime; // when participant leaves this slot
Download