/* * (C) COPYRIGHT Vincent S. Cojot and others 1996-1997 * All Rights Reserved * Licensed Materials - Property of Vincent S. Cojot and others. * Use, duplication or disclosure restricted by Vincent S. Cojot. */ /* #define DEBUG_COMM */ /* flag qui permet d'afficher l'envoie et la reception des paquets a utiliser une fois pour s'assurer que tout fonctionne. */ /* ------------------------------------------------*/ /* Definitions locales au programme. */ /* ------------------------------------------------*/ GLvoid ForkIPCDaemon(GLvoid); GLvoid CopyPacketsInLocalMem (GLvoid); GLvoid SendOnePacket(GLvoid *msg); GLvoid CloseSegment (GLvoid); GLvoid ReceiveOnePacket(GLvoid); GLvoid SetupNetworkConnection(GLvoid); GLvoid SetupSendingPacket(GLvoid); GLvoid SetupReceivingPacket(GLvoid); GLvoid SendMyTankPacket(GLvoid); GLvoid SendMyDyingTankPacket(GLvoid); GLvoid SendMyMissilePacket(GLvoid); GLvoid SendMyExplosionPacket(GLvoid); PMEM *mem; struct sockaddr_in addr; struct in_addr grpaddr; int addrlen,fd; /* ------------------------------------------------*/ /* Definitions des matrices globales pour le jeu en reseau. */ /* On y trouve les definitions des structures de donnees de */ /* tous les tanks, missiles et explosions ainsi que des variables */ /* indiquant le nombre de ces objets. */ /* ------------------------------------------------*/ extern TANK Tanks[MAX_TANKS]; extern MISSILE Missiles[MAX_MISSILES]; extern EXPLOSION Explosions[MAX_EXPLOSIONS]; extern TANK DestroyedTanks[MAX_DESTROYED_TANKS]; /* ------------------------------------------------*/ /* Definitions diverses necessaires au programme. */ /* ------------------------------------------------*/ extern pid_t ForkPID; extern int shmid1; extern int shmid2; extern STATUS_IPC *GameStatus; extern TANK OneTank; extern MISSILE OneMissile; extern EXPLOSION OneExplosion; extern PTANK OneTankPacket; extern PMISSILE OneMissilePacket; extern PEXPLOSION OneExplosionPacket; extern GLfloat TimeTravel; extern GLfloat scenePosx ; extern GLfloat scenePosz ; extern GLfloat sceneAngle; extern GLint LongSpeed; extern GLint RotaSpeed; extern GLfloat GameAge; extern char OurName[10]; extern GLvoid InsertTank(TANK OneTank); extern GLvoid InsertMissile(MISSILE OneMissile); extern GLvoid InsertExplosion(EXPLOSION OneExplosion); extern GLvoid InsertDestroyedTank(TANK OneDestroyedTank); extern GLvoid ExplodeTank(GLint Which); extern GLvoid ExplodeMissile(GLint Which, GLint Who); extern GLvoid KilledFromNetworkGame(char *Who); extern GLint explosion; extern GLint tanks; extern GLint FlyingMissile; extern GLint destroyed; extern char loginname[10]; extern char hostname[10]; extern char network_group[255]; extern u_short network_port; extern long network_delay;