ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/MSVC/Flatline_PacketBuilder.c
(Generate patch)

Comparing Daodan/MSVC/Flatline_PacketBuilder.c (file contents):
Revision 585 by gumby, Tue Jan 25 17:18:05 2011 UTC vs.
Revision 586 by gumby, Wed Feb 2 08:17:19 2011 UTC

# Line 3 | Line 3
3  
4   #define FLAG_AND_INCREMENT( FLAG )      PD->UpdateFlags |= (1 << FLAG ); DataPointer += FLpData_PartSize( FLAG );
5  
6 < void FLsPacketBuild( uint8_t p, PlayerData* PD )
6 > void FLsPacketBuild( uint8_t p, PlayerData* PD, bool UpdateAll )
7   {
8          Character* Player = PlayerList[p]->Chr;
9          ActiveCharacter* APlayer = ONrGetActiveCharacter(Player);
# Line 37 | Line 37 | void FLsPacketBuild( uint8_t p, PlayerDa
37          }
38  
39          if( PI->Facings.Facing != Player->Facing ||
40 <                PI->Facings.DesiredFacing != Player->DesiredFacing )
40 >                PI->Facings.DesiredFacing != Player->DesiredFacing || UpdateAll )
41          {
42                  PlayerFacing* ptr = (void*)DataPointer;
43                  ptr->Facing = Player->Facing;
# Line 49 | Line 49 | void FLsPacketBuild( uint8_t p, PlayerDa
49          }
50  
51          if(PI->Health.Health != Player->Health ||
52 <                PI->Health.MaxHealth != Player->MaxHealth )
52 >                PI->Health.MaxHealth != Player->MaxHealth || UpdateAll )
53          {
54                  PlayerHealth* ptr = (void*)DataPointer;
55                  ptr->Health = Player->Health;
# Line 88 | Line 88 | void FLsPacketBuild( uint8_t p, PlayerDa
88                  //Do inventory
89          }
90  
91 <        if( PI->Class != Player->ONCC )
91 >        if( PI->Class != Player->ONCC || UpdateAll )
92          {
93                  sprintf_s( DataPointer, 32, "%s", TMrInstance_GetInstanceName( Player->ONCC ) );
94 +                sprintf_s( PI->ClassString, 32, "%s", DataPointer );
95                  PI->Class = Player->ONCC;
96  
97                  FLAG_AND_INCREMENT( PFlag_Class );
# Line 98 | Line 99 | void FLsPacketBuild( uint8_t p, PlayerDa
99  
100          if(APlayer)
101          {
102 <                if( (APlayer->PhyContext) && memcmp(&PI->Position, &APlayer->PhyContext->Position, sizeof(Vector3)) )
102 >                if( (APlayer->PhyContext) && (memcmp(&PI->Position, &APlayer->PhyContext->Position, sizeof(Vector3)) || UpdateAll ))
103                  {
104                          Vector3* ptr = (Vector3*)DataPointer;
105                          *ptr = PI->Position = APlayer->PhyContext->Position;
# Line 106 | Line 107 | void FLsPacketBuild( uint8_t p, PlayerDa
107                          FLAG_AND_INCREMENT( PFlag_Position );
108                  }
109  
110 <                if(APlayer->Animation != PI->Animation)
110 >                if(APlayer->Animation != PI->Animation || !APlayer->Frame || UpdateAll )
111                  {
112                          sprintf_s( DataPointer, 32, "%s", TMrInstance_GetInstanceName( APlayer->Animation ) );
113 +                        sprintf_s( PI->AnimationString, 32, "%s", DataPointer );
114                          PI->Animation = APlayer->Animation;
115 +
116                          
117                          FLAG_AND_INCREMENT( PFlag_Animation );
118                  }
119  
120                  if(APlayer->targetThrow)
121                  {
122 <                        if(!PI->HasAppliedThrow)
122 >                        if(!PI->HasAppliedThrow || UpdateAll )
123                          {
124                                  PlayerThrowData* ptr = (void*)DataPointer;
125                                  ptr->throwing = Players[APlayer->throwing].list_slot;
# Line 163 | Line 166 | void FLsSendPlayerData()
166          {
167                  if(PlayerList[p] && PlayerList[p]->Chr)
168                  {
169 <                        FLsPacketBuild(p, &BuildData[p]);
169 >                        FLsPacketBuild(p, &BuildData[p], 0);
170                          
171                          assert( BuildData[p].Size < 255 );
172                          

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)