| 3 |
|
#include "Flatline_Client.h" |
| 4 |
|
#include "Flatline_Server.h" |
| 5 |
|
#include "Flatline_Events.h" |
| 6 |
+ |
#include "Daodan_Utility.h" |
| 7 |
|
#include <Windows.h> |
| 8 |
|
//#include <sys/time.h> |
| 9 |
|
#include <time.h> |
| 295 |
|
|
| 296 |
|
input_packet.id = PLAYER_INPUT; |
| 297 |
|
input_packet.input_struct.Time = ONgGameState->GameTime; |
| 298 |
< |
input_packet.input_struct.Actions1 = ((GameState*)(ONgGameState))->Input.Current.Actions1; |
| 299 |
< |
input_packet.input_struct.Actions2 = ((GameState*)(ONgGameState))->Input.Current.Actions2; |
| 300 |
< |
input_packet.input_struct.MouseDeltaX = ((GameState*)(ONgGameState))->Input.MouseDeltaX; |
| 301 |
< |
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; |
| 302 |
|
|
| 303 |
|
sent_bytes = NetUDPSocket_Send(client_sock,(sockaddr *) &address, (char*)&input_packet, sizeof(input_struct) + FLATLINE_HEADER); |
| 304 |
|
|
| 331 |
|
GameInput * Active_Input; |
| 332 |
|
if(PlayerList[i] == 0) continue; |
| 333 |
|
|
| 334 |
+ |
|
| 335 |
+ |
|
| 336 |
|
Player = PlayerList[i]->Chr; |
| 337 |
|
Active_Player = ONrGetActiveCharacter( PlayerList[i]->Chr); |
| 338 |
|
|
| 423 |
|
|
| 424 |
|
if(Active_Player == 0) continue; |
| 425 |
|
|
| 426 |
+ |
|
| 427 |
+ |
if(client_connected) { |
| 428 |
+ |
Active_Player->PlayingFilm.Flags = 1; |
| 429 |
+ |
} |
| 430 |
+ |
|
| 431 |
+ |
|
| 432 |
|
if( client_connected && DoWeUpdateThis( PlayerList[i]->UpdateFlags, PFlag_Position) ) |
| 433 |
|
{ |
| 434 |
|
Active_Player->PhyContext->Position = PlayerList[i]->Position; |
| 451 |
|
/////////////////////////////////// |
| 452 |
|
//TODO: Check age of animation |
| 453 |
|
/////////////////////////////////// |
| 454 |
< |
|
| 454 |
> |
DDrConsole_PrintF("Changing animation from %s to %s", |
| 455 |
> |
TMrInstance_GetInstanceName( Active_Player->Animation ), |
| 456 |
> |
TMrInstance_GetInstanceName( PlayerList[i]->Animation ) ); |
| 457 |
|
// set the characters animation |
| 458 |
|
/*ONrCharacter_SetAnimationInternal(Player, |
| 459 |
|
Active_Player, |
| 460 |
|
Active_Player->AnimationToState, |
| 461 |
|
0, |
| 462 |
< |
Animation);*/ |
| 462 |
> |
PlayerList[i]->Animation);*/ |
| 463 |
|
//ONrCharacter_NewAnimationHook(Player, Active_Player); |
| 464 |
< |
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); |
| 465 |
|
//ONrCharacter_NewAnimationHook(Player, Active_Player); |
| 466 |
|
} |
| 467 |
|
|
| 530 |
|
if (Active_Player->ThrowTargetCharacter) |
| 531 |
|
{ |
| 532 |
|
Target->Frame += 2; |
| 533 |
< |
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; |
| 536 |
|
} |
| 537 |
|
} |
| 538 |
|
} |
| 547 |
|
//Always discard old throw data, even if it isnt applied |
| 548 |
|
PlayerList[i]->UpdateFlags &= ~( 1 << PFlag_Throws ); |
| 549 |
|
|
| 537 |
– |
//Active_Player->PlayingFilm.Flags = 1; |
| 550 |
|
Active_Input = &(Active_Player->Input); |
| 551 |
|
|
| 552 |
|
if( (server_started && i !=0) || !server_started ) |