All pastes #90502 Raw Edit

Someone

public text v1 · immutable
#90502 ·published 2006-07-17 19:11 UTC
rendered paste body
$ cvs diff include/bzfsAPI.h src/bzfs/bzfsAPI.cxx src/bzfs/WorldWeapons.{cxx,h}
Index: include/bzfsAPI.h
===================================================================
RCS file: /cvsroot/bzflag/bzflag/include/bzfsAPI.h,v
retrieving revision 1.135
diff -r1.135 bzfsAPI.h
982a983
> BZF_API int bz_fireWorldGM ( int targetPlayerID, float lifetime, float *pos, float tilt, float direction, float dt);
1155c1156
< typedef enum
---
> typedef enum
1184c1185
<       void update ( void );
---
>       void update ( void );
1342c1343
< typedef struct
---
> typedef struct
1357c1358
< typedef struct
---
> typedef struct
1371c1372
< typedef struct
---
> typedef struct
1381c1382
< typedef struct
---
> typedef struct
1405c1406
< typedef struct
---
> typedef struct
1422c1423
<       bz_ePlayerStatus        status;
---
>       bz_ePlayerStatus        status;
1444c1445
< typedef enum
---
> typedef enum
Index: src/bzfs/bzfsAPI.cxx
===================================================================
RCS file: /cvsroot/bzflag/bzflag/src/bzfs/bzfsAPI.cxx,v
retrieving revision 2.137
diff -r2.137 bzfsAPI.cxx
1094a1095,1116
> BZF_API int bz_fireWorldGM ( int targetPlayerID, float lifetime, float *pos, float tilt, float direction, float dt)
> {
>     const char* flagType = "GM";
>
>     if (!pos || !flagType)
>         return false;
>
>     FlagTypeMap &flagMap = FlagType::getFlagMap();
>     if (flagMap.find(std::string(flagType)) == flagMap.end())
>         return false;
>
>     FlagType *flag = flagMap.find(std::string(flagType))->second;
>
>     PlayerId player = ServerPlayer;
>
>     int shotID =  world->getWorldWeapons().getNewWorldShotID();
>
>     fireWorldGM(flag,targetPlayerID, lifetime,player,pos,tilt,direction, shotID, dt);
>
>     return shotID;
> }
>
1346c1368
<       if (ifs.fail())
---
>       if (ifs.fail())
1351c1373
<       while (std::getline(ifs, line))
---
>       while (std::getline(ifs, line))
1551c1573
<               }
---
>               }
2495,2496c2517,2518
<
<   switch(targetTeam)
---
>
>   switch(targetTeam)
Index: src/bzfs/WorldWeapons.cxx
===================================================================
RCS file: /cvsroot/bzflag/bzflag/src/bzfs/WorldWeapons.cxx,v
retrieving revision 2.32
diff -r2.32 WorldWeapons.cxx
68a69,100
> static int fireWorldGMReal ( FlagType* type, PlayerId targetPlayerID, float
>         lifetime, PlayerId player, float *pos, float tilt, float dir, int shotID,
>         float dt)
> {
>
>     void *buf, *bufStart = getDirectMessageBuffer();
>
>     FiringInfo firingInfo;
>     firingInfo.timeSent = (float)TimeKeeper::getCurrent().getSeconds();
>     firingInfo.flagType = type;
>     firingInfo.lifetime = lifetime;
>     firingInfo.shot.player = player;
>     memmove(firingInfo.shot.pos, pos, 3 * sizeof(float));
>     const float shotSpeed = BZDB.eval(StateDatabase::BZDB_SHOTSPEED);
>     const float tiltFactor = cosf(tilt);
>     firingInfo.shot.vel[0] = shotSpeed * tiltFactor * cosf(dir);
>     firingInfo.shot.vel[1] = shotSpeed * tiltFactor * sinf(dir);
>     firingInfo.shot.vel[2] = shotSpeed * sinf(tilt);
>     firingInfo.shot.id = shotID;
>     firingInfo.shot.dt = dt;
>
>     firingInfo.shot.team = RogueTeam;
>
>     buf = firingInfo.pack(bufStart);
>
>     if (BZDB.isTrue(StateDatabase::BZDB_WEAPONS)) {
>         broadcastMessage(MsgShotBegin, (char *)buf - (char *)bufStart,
>                          bufStart);
>     }
>
>     // Target the gm.
>     // construct and send packet
69a102,111
>     char packet[ShotUpdatePLen + PlayerIdPLen];
>     buf = (void*)packet;
>     buf = firingInfo.shot.pack(buf);
>     buf = nboPackUByte(buf, targetPlayerID);
>     if (BZDB.isTrue(StateDatabase::BZDB_WEAPONS)) {
>         broadcastMessage(MsgGMUpdate, sizeof(packet), packet);
>     }
>
>     return shotID;
> }
259a302,308
> int fireWorldGM(FlagType* type, PlayerId targetPlayerID, float lifetime,
>                 PlayerId player, float *pos, float tilt, float direction, int
>                 shotID, float dt)
> {
>     return fireWorldGMReal(type, targetPlayerID, lifetime, player, pos, tilt,
>                            direction, shotID, dt);
> }
Index: src/bzfs/WorldWeapons.h
===================================================================
RCS file: /cvsroot/bzflag/bzflag/src/bzfs/WorldWeapons.h,v
retrieving revision 2.15
diff -r2.15 WorldWeapons.h
92a93,94
> int fireWorldGM(FlagType* type, PlayerId targetPlayerID, float lifetime, PlayerId player, float *pos, float tilt, float direction, int shotID, float dt);
>