00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GENVSI_H
00016 #define GENVSI_H
00017
00018 #include "Genesis.h"
00019
00020
00021
00022 typedef int32 GenVSI_CHandle;
00023 typedef int32 GenVSI_PHandle;
00024 #define CLIENT_NULL_HANDLE -1
00025
00026
00027
00028 typedef enum
00029 {
00030 MODE_Server,
00031 MODE_SmartClient,
00032 MODE_DumbClient,
00033 MOVE_ServerClient
00034 } GenVSI_Mode;
00035
00036 typedef struct
00037 {
00038 float MoveTime;
00039 float ForwardSpeed;
00040 geVec3d Angles;
00041 uint16 ButtonBits;
00042
00043 uint16 Weapon;
00044
00045 geVec3d Pos;
00046
00047 float PingTime;
00048 } GenVSI_CMove;
00049
00050
00051
00052
00053
00054
00055 #define HOST_BUTTON_JUMP (1<<0)
00056 #define HOST_BUTTON_LEFT (1<<1)
00057 #define HOST_BUTTON_RIGHT (1<<2)
00058 #define HOST_BUTTON_FIRE (1<<3)
00059
00060
00061
00062
00063
00064
00065 #define VIEW_INDEX_NONE 0xffff
00066
00067
00068 #define VIEW_TYPE_NONE (1<<0)
00069
00070 #define VIEW_TYPE_ACTOR (1<<2)
00071 #define VIEW_TYPE_MODEL (1<<3)
00072 #define VIEW_TYPE_MODEL_OPEN (1<<4)
00073 #define VIEW_TYPE_LIGHT (1<<5)
00074 #define VIEW_TYPE_SPRITE (1<<6)
00075 #define VIEW_TYPE_YAW_ONLY (1<<7) // Used for viewplayers/clients, etc..
00076 #define VIEW_TYPE_LOCAL (1<<8) // On local server only currently
00077 #define VIEW_TYPE_FORCE_XFORM (1<<10) // Do not use clients angles, bbut xform instead (good for when dead so roll will be in)
00078 #define VIEW_TYPE_TOUCH (1<<11)
00079 #define VIEW_TYPE_STANDON (1<<12)
00080 #define VIEW_TYPE_COLLIDEMODEL (1<<13) // Collide models against this item
00081 #define VIEW_TYPE_PHYSOB (1<<14)
00082 #define VIEW_TYPE_HACK (1<<15)
00083
00084 typedef struct GenVSI GenVSI;
00085
00086
00087 typedef geBoolean GenVSI_NewWorldCB(GenVSI *VSI, const char *WorldName, geVFile *MainFS);
00088 typedef geBoolean GenVSI_ShutdownWorldCB(GenVSI *VSI);
00089
00090 typedef void GenVSI_SpawnFunc(GenVSI *VSI, void *Player, void *ClassData, char *EntityName);
00091 typedef void GenVSI_DestroyFunc(GenVSI *VSI, void *Player, void *ClassData);
00092
00093 typedef void GenVSI_SetCSpawnCB(void *UData, const char *ClassName, GenVSI_SpawnFunc *Func, GenVSI_DestroyFunc *DFunc);
00094 typedef void GenVSI_SetWorldCB(void *UData, GenVSI_NewWorldCB *NewWorldCB, GenVSI_ShutdownWorldCB *ShutdownWorldCB, const char *WorldName);
00095 typedef void GenVSI_ActorIndexCB(void *UData, uint16 Index, const char *GFXPath, const char *FileName);
00096 typedef void GenVSI_MotionIndexCB(void *UData, uint16 Index, const char *MotionName);
00097 typedef void GenVSI_BoneIndexCB(void *UData, uint16 Index, const char *BoneName);
00098 typedef void GenVSI_TextureIndexCB(void *UData, uint16 Index, const char *TextureName, const char *ATextureName);
00099 typedef void GenVSI_SoundIndexCB(void *UData, uint16 Index, const char *FileName);
00100
00101 typedef void GenVSI_PlaySoundCB(void *UData, uint16 Index, const geVec3d *Pos);
00102 typedef void GenVSI_SpawnFxCB(void *UData, uint8 FxNum, const geVec3d *Pos, uint8 SoundIndex);
00103
00104 typedef void *GenVSI_GetPClientDataCB(void *UData, GenVSI_CHandle ClientHandle);
00105 typedef void GenVSI_SetClientValue(void *UData, GenVSI_CHandle ClientHandle, int32 Value);
00106 typedef GenVSI_CMove *GenVSI_GetClientMoveCB(void *UData, GenVSI_CHandle ClientHandle);
00107 typedef geBoolean GenVSI_IsClientBotCB(void *UData, GenVSI_CHandle ClientHandle);
00108 typedef geBoolean GenVSI_ClientDisconnectCB(void *UData, GenVSI_CHandle ClientHandle);
00109
00110 typedef uint16 GenVSI_ModelToVIndexCB(void *UData, geWorld_Model *Model);
00111 typedef void GenVSI_RegisterPModelCB(void *UData, void *PlayerData, geWorld_Model *Model);
00112 typedef void *GenVSI_GetNextPlayerCB(void *UData, void *Start, const char *ClassName);
00113 typedef void *GenVSI_GetNextPlayerRCB(void *UData, void *PlayerData, void *Start, const char *ClassName, float Radius);
00114 typedef void GenVSI_SetViewPlayerCB(void *UData, GenVSI_CHandle ClientHandle, void *PlayerData);
00115 typedef geBoolean GenVSI_MovePModelCB(void *UData, void *PlayerData, const geXForm3d *DestXForm);
00116 typedef void GenVSI_GetPlayerTExtCB(void *UData, void *PlayerData, uint16 MotionIndex, float *Start, float *End);
00117 typedef void GenVSI_SetCInvCB(void *UData, GenVSI_CHandle ClientHandle, int32 Slot, uint16 Amount, geBoolean HasItem);
00118 typedef void *GenVSI_ActorToPlayerCB(void *UData, geActor *Actor);
00119
00120 typedef geWorld *GenVSI_GetWorldCB(void *UData);
00121 typedef void GenVSI_ConsolePrintfCB(void *Udata, const char *Str, ...);
00122 typedef void GenVSI_ConsoleHeaderPrintfCB(void *Udata, int32 ClientHandle, geBoolean AllClients, const char *Str, ...);
00123 typedef float GenVSI_GetTimeCB(void *UData);
00124
00125
00126 typedef void *GenVSI_SpawnPlayerCB(void *UData, const char *ClassName);
00127 typedef void GenVSI_DestroyPlayerCB(void *UData, void *PlayerData);
00128
00129
00130 typedef void GenVSI_ProcIndexCB(void *UData, uint16 Index, void *Proc);
00131
00132 typedef struct GenVSI
00133 {
00134 GenVSI_Mode Mode;
00135
00136 geWorld *World;
00137
00138
00139
00140 GenVSI_SetCSpawnCB *SetClassSpawn;
00141 GenVSI_SetWorldCB *SetWorld;
00142 GenVSI_ActorIndexCB *ActorIndex;
00143 GenVSI_MotionIndexCB *MotionIndex;
00144 GenVSI_BoneIndexCB *BoneIndex;
00145 GenVSI_TextureIndexCB *TextureIndex;
00146 GenVSI_SoundIndexCB *SoundIndex;
00147
00148
00149 GenVSI_PlaySoundCB *PlaySound;
00150 GenVSI_SpawnFxCB *SpawnFx;
00151
00152
00153 GenVSI_GetPClientDataCB *GetPlayerClientData;
00154 GenVSI_SetClientValue *SetClientScore;
00155 GenVSI_SetClientValue *SetClientHealth;
00156 GenVSI_SetClientValue *SetClientWeapon;
00157 GenVSI_SetCInvCB *SetClientInventory;
00158 GenVSI_GetClientMoveCB *GetClientMove;
00159 GenVSI_IsClientBotCB *IsClientBot;
00160 GenVSI_ClientDisconnectCB *ClientDisconnect;
00161
00162
00163 GenVSI_ModelToVIndexCB *ModelToViewIndex;
00164 GenVSI_RegisterPModelCB *RegisterPlayerModel;
00165 GenVSI_GetNextPlayerCB *GetNextPlayer;
00166 GenVSI_GetNextPlayerRCB *GetNextPlayerInRadius;
00167 GenVSI_SetViewPlayerCB *SetViewPlayer;
00168 GenVSI_MovePModelCB *MovePlayerModel;
00169 GenVSI_GetPlayerTExtCB *GetPlayerTimeExtents;
00170 GenVSI_ActorToPlayerCB *ActorToPlayer;
00171 GenVSI_GetWorldCB *GetWorld;
00172 GenVSI_ConsolePrintfCB *ConsolePrintf;
00173 GenVSI_ConsoleHeaderPrintfCB *ConsoleHeaderPrintf;
00174 GenVSI_GetTimeCB *GetTime;
00175
00176 GenVSI_SpawnPlayerCB *SpawnPlayer;
00177 GenVSI_DestroyPlayerCB *DestroyPlayer;
00178
00179 GenVSI_ProcIndexCB *ProcIndex;
00180
00181 void *UData;
00182
00183 } GenVSI;
00184
00185
00186
00187 void GenVSI_SetClassSpawn(GenVSI *VSI, const char *ClassName, GenVSI_SpawnFunc *Func, GenVSI_DestroyFunc *DFunc);
00188 void GenVSI_SetWorld(GenVSI *VSI, GenVSI_NewWorldCB *NewWorldCB, GenVSI_ShutdownWorldCB *ShutdownWorldCB, const char *WorldName);
00189 void GenVSI_ActorIndex(GenVSI *VSI, uint16 Index, const char *GFXPath, const char *FileName);
00190 void GenVSI_MotionIndex(GenVSI *VSI, uint16 Index, const char *MotionName);
00191 void GenVSI_BoneIndex(GenVSI *VSI, uint16 Index, const char *BoneName);
00192 void GenVSI_TextureIndex(GenVSI *VSI, uint16 Index, const char *TextureName, const char *ATextureName);
00193 void GenVSI_SoundIndex(GenVSI *VSI, uint16 Index, const char *FileName);
00194
00195
00196 void GenVSI_PlaySound(GenVSI *VSI, uint16 Index, const geVec3d *Pos);
00197 void GenVSI_SpawnFx(GenVSI *VSI, uint8 FxNum, const geVec3d *Pos, uint8 SoundIndex);
00198
00199
00200
00201
00202
00203
00204
00205 void *GenVSI_GetPlayerClientData(GenVSI *VSI, GenVSI_CHandle ClientHandle);
00206 void GenVSI_SetClientScore(GenVSI *VSI, GenVSI_CHandle ClientHandle, int32 Score);
00207 void GenVSI_SetClientHealth(GenVSI *VSI, GenVSI_CHandle ClientHandle, int32 Health);
00208 void GenVSI_SetClientWeapon(GenVSI *VSI, GenVSI_CHandle ClientHandle, int32 Weapon);
00209 void GenVSI_SetClientInventory(GenVSI *VSI, GenVSI_CHandle ClientHandle, int32 Slot, uint16 Amount, geBoolean HasItem);
00210 GenVSI_CMove *GenVSI_GetClientMove(GenVSI *VSI, GenVSI_CHandle ClientHandle);
00211 geBoolean GenVSI_IsClientBot(GenVSI *VSI, GenVSI_CHandle ClientHandle);
00212 geBoolean GenVSI_ClientDisconnect(GenVSI *VSI, GenVSI_CHandle ClientHandle);
00213
00214
00215 void *GenVSI_GetNextPlayer(GenVSI *VSI, void *Start, const char *ClassName);
00216 void *GenVSI_GetNextPlayerInRadius(GenVSI *VSI, void *PlayerData, void *Start, const char *ClassName, float Radius);
00217 void GenVSI_SetViewPlayer(GenVSI *VSI, GenVSI_CHandle ClientHandle, void *PlayerData);
00218 uint16 GenVSI_ModelToViewIndex(GenVSI *VSI, geWorld_Model *Model);
00219 void GenVSI_RegisterPlayerModel(GenVSI *VSI, void *PlayerData, geWorld_Model *Model);
00220 geBoolean GenVSI_MovePlayerModel(GenVSI *VSI, void *PlayerData, const geXForm3d *DestXForm);
00221 void GenVSI_GetPlayerTimeExtents(GenVSI *VSI, void *PlayerData, uint16 MotionIndex, float *Start, float *End);
00222 void *GenVSI_ActorToPlayer(GenVSI *VSI, geActor *Actor);
00223
00224 geWorld *GenVSI_GetWorld(GenVSI *VSI);
00225 void *GenVSI_GetPlayerData(GenVSI *VSI, GenVSI_PHandle PlayerHandle);
00226 void GenVSI_ConsolePrintf(GenVSI *VSI, const char *Str, ...);
00227 void GenVSI_ConsoleHeaderPrintf(GenVSI *VSI, int32 ClientHandle, geBoolean AllClients, const char *Str, ...);
00228 float GenVSI_GetTime(GenVSI *VSI);
00229
00230 void *GenVSI_SpawnPlayer(GenVSI *VSI, const char *ClassName);
00231 void GenVSI_DestroyPlayer(GenVSI *VSI, void *PlayerData);
00232
00233 void GenVSI_ProcIndex(GenVSI *VSI, uint16 Index, void *Proc);
00234
00235 #endif