- Timestamp:
- Jan 25, 2011, 6:18:05 PM (14 years ago)
- Location:
- Daodan/MSVC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/MSVC/Flatline.c
r584 r585 4 4 #include "Flatline_Server.h" 5 5 #include "Flatline_Events.h" 6 #include "Daodan_Utility.h" 6 7 #include <Windows.h> 7 8 //#include <sys/time.h> … … 295 296 input_packet.id = PLAYER_INPUT; 296 297 input_packet.input_struct.Time = ONgGameState->GameTime; 297 input_packet.input_struct.Actions1 = ((GameState*)(ONgGameState))->Input.Current.Actions1;298 input_packet.input_struct.Actions2 = ((GameState*)(ONgGameState))->Input.Current.Actions2;299 input_packet.input_struct.MouseDeltaX = ((GameState*)(ONgGameState))->Input.MouseDeltaX;300 input_packet.input_struct.MouseDeltaY = ((GameState*)(ONgGameState))->Input.MouseDeltaY;298 input_packet.input_struct.Actions1 = ONgGameState->Input.Current.Actions1; 299 input_packet.input_struct.Actions2 = ONgGameState->Input.Current.Actions2; 300 input_packet.input_struct.MouseDeltaX = ONgGameState->Input.MouseDeltaX; 301 input_packet.input_struct.MouseDeltaY = ONgGameState->Input.MouseDeltaY; 301 302 302 303 sent_bytes = NetUDPSocket_Send(client_sock,(sockaddr *) &address, (char*)&input_packet, sizeof(input_struct) + FLATLINE_HEADER); … … 331 332 if(PlayerList[i] == 0) continue; 332 333 334 335 333 336 Player = PlayerList[i]->Chr; 334 337 Active_Player = ONrGetActiveCharacter( PlayerList[i]->Chr); … … 421 424 if(Active_Player == 0) continue; 422 425 426 427 if(client_connected) { 428 Active_Player->PlayingFilm.Flags = 1; 429 } 430 431 423 432 if( client_connected && DoWeUpdateThis( PlayerList[i]->UpdateFlags, PFlag_Position) ) 424 433 { … … 443 452 //TODO: Check age of animation 444 453 /////////////////////////////////// 445 454 DDrConsole_PrintF("Changing animation from %s to %s", 455 TMrInstance_GetInstanceName( Active_Player->Animation ), 456 TMrInstance_GetInstanceName( PlayerList[i]->Animation ) ); 446 457 // set the characters animation 447 458 /*ONrCharacter_SetAnimationInternal(Player, … … 449 460 Active_Player->AnimationToState, 450 461 0, 451 Animation);*/462 PlayerList[i]->Animation);*/ 452 463 //ONrCharacter_NewAnimationHook(Player, Active_Player); 453 ONrCharacter_SetAnimationExternal(Player, TRrAnimation_GetFrom(PlayerList[i]->Animation), PlayerList[i]->Animation, 0);464 ONrCharacter_SetAnimationExternal(Player, TRrAnimation_GetFrom(PlayerList[i]->Animation), PlayerList[i]->Animation, 1); 454 465 //ONrCharacter_NewAnimationHook(Player, Active_Player); 455 466 } … … 520 531 { 521 532 Target->Frame += 2; 522 Target->thrownBy = Player->Number; 533 DDrConsole_PrintF("Thrown by player %hi", Player->Number ); 534 DDrStartupMessage("Thrown by player %hi", Player->Number ); 535 Target->thrownBy = Player->Number & 0x00ff; 523 536 } 524 537 } … … 535 548 PlayerList[i]->UpdateFlags &= ~( 1 << PFlag_Throws ); 536 549 537 //Active_Player->PlayingFilm.Flags = 1;538 550 Active_Input = &(Active_Player->Input); 539 551 -
Daodan/MSVC/Flatline_Client.c
r584 r585 73 73 74 74 75 //DDrPatch_Byte(0x04ED6FB, 0xEB);75 DDrPatch_Byte(0x04ED6FB, 0xEB); 76 76 77 77 //DDrConsole_PrintF("Slot %i", ((connect_reply*)packet)->player_slot); -
Daodan/MSVC/Flatline_PacketBuilder.c
r584 r585 32 32 { 33 33 memcpy( DataPointer, &PI->InputFromClient, sizeof(PlayerInput)); 34 PI->Input FromClient = PI->Input;34 PI->Input = PI->InputFromClient; 35 35 36 36 FLAG_AND_INCREMENT( PFlag_Input ); … … 99 99 if(APlayer) 100 100 { 101 if( memcmp(&PI->Position, &APlayer->PhyContext->Position, sizeof(Vector3)) )101 if( (APlayer->PhyContext) && memcmp(&PI->Position, &APlayer->PhyContext->Position, sizeof(Vector3)) ) 102 102 { 103 103 Vector3* ptr = (Vector3*)DataPointer; … … 109 109 if(APlayer->Animation != PI->Animation) 110 110 { 111 sprintf_s( DataPointer, 32, "%s", TMrInstance_GetInstanceName( PI->Animation ) );111 sprintf_s( DataPointer, 32, "%s", TMrInstance_GetInstanceName( APlayer->Animation ) ); 112 112 PI->Animation = APlayer->Animation; 113 113 … … 137 137 } 138 138 139 PD->Size = ( char)DataPointer - (char)PD;139 PD->Size = (uint32_t)DataPointer - (uint32_t)PD; 140 140 141 141 PI->UpdateFlags = PD->UpdateFlags; … … 168 168 assert( BuildData[p].Size < 255 ); 169 169 170 //If we hit maximum size, send the packet and reset the buffer for a new one 171 if( BuildData[p].Size + PacketSize > max_packet_size ) 170 if( BuildData[p].Size > 0 ) 172 171 { 173 UDPServer_SendToAll(&OutputPacket, PacketSize + FLATLINE_HEADER); 174 175 memset( OutputPacket.data, 0, PacketSize ); 176 OutputPointer = OutputPacket.data; 177 PacketSize = 0; 172 173 //If we hit maximum size, send the packet and reset the buffer for a new one 174 if( BuildData[p].Size + PacketSize > max_packet_size ) 175 { 176 UDPServer_SendToAll(&OutputPacket, PacketSize + FLATLINE_HEADER); 177 178 memset( OutputPacket.data, 0, PacketSize ); 179 OutputPointer = OutputPacket.data; 180 PacketSize = 0; 181 } 182 183 //add to the packet 184 memcpy( OutputPointer, &BuildData[p], BuildData[p].Size ); 185 186 OutputPointer += BuildData[p].Size; 187 PacketSize += BuildData[p].Size; 178 188 } 179 180 //add to the packet181 memcpy( OutputPointer, &BuildData[p], BuildData[p].Size );182 183 OutputPointer += BuildData[p].Size;184 PacketSize += BuildData[p].Size;185 189 } 186 190 }
Note:
See TracChangeset
for help on using the changeset viewer.