219 |
|
return NetUDPServer_Listen(27777, FLrServer_PacketCallback); |
220 |
|
} |
221 |
|
|
222 |
+ |
|
223 |
|
RGBA green = {0, 0xFF, 0, 0}; |
224 |
|
RGBA red = {0, 0, 0xFF, 0}; |
225 |
|
RGBA grey = {0x80,0x80,0x80,0x80}; |
511 |
|
void * ONICALL FLrInput_Update_Keys(void) |
512 |
|
{ |
513 |
|
uint16_t i; |
514 |
< |
/*DDrConsole_PrintF("Current: %x %x | Start: %x %x | Stop: %x %x | Stopped %x %x", |
514 |
> |
/*DDrConsole_PrintF("Current: %x %x | Start: %x %x | Stop: %x %x | Stopped %x %x", |
515 |
|
ONgGameState->Input.Current.Actions1, ONgGameState->Input.Current.Actions2, |
516 |
|
ONgGameState->Input.Start.Actions1,ONgGameState->Input.Start.Actions2, |
517 |
|
ONgGameState->Input.Stop.Actions1, ONgGameState->Input.Stop.Actions2, |
519 |
|
); |
520 |
|
*/ |
521 |
|
ActiveCharacter * Active_Player = ONgGameState->ActiveCharacters; |
522 |
+ |
Active_Player->PhyContext->Rotation; |
523 |
+ |
Active_Player->PhyContext->Position; |
524 |
+ |
ONgGameState->PlayerCharacter->Position; |
525 |
+ |
|
526 |
+ |
|
527 |
|
|
528 |
+ |
/* |
529 |
+ |
if( ONgGameState->Input.MouseDeltaX != 0 || ONgGameState->Input.MouseDeltaY != 0 || |
530 |
+ |
ONgGameState->Input.field_8 != 0 || ONgGameState->Input.field_C != 0 ) |
531 |
+ |
|
532 |
+ |
DDrConsole_PrintF("%f %f | %f %f", |
533 |
+ |
ONgGameState->Input.MouseDeltaX , ONgGameState->Input.MouseDeltaY, |
534 |
+ |
ONgGameState->Input.field_8, ONgGameState->Input.field_C); |
535 |
+ |
|
536 |
+ |
*/ |
537 |
|
//if sprint timer is equal to 0, display 0 |
538 |
|
//else if sprint timer is equal to -1, display -1 |
539 |
|
//else display difference |
579 |
|
if(server_started) { |
580 |
|
player_data * data; |
581 |
|
flatline_packet data_out = {0}; |
582 |
+ |
|
583 |
+ |
//if( PlayerList[i]->Chr->Health == 0) PlayerList[i]->Chr->Health = PlayerList[i]->Chr->MaxHealth; |
584 |
+ |
|
585 |
|
data_out.id = PLAYER_DATA; |
586 |
|
data = (void*)&(data_out.data); |
587 |
|
data->PlayerNum = i; |
593 |
|
data->Facing = PlayerList[i]->Chr->Facing; |
594 |
|
data->DesiredFacing = PlayerList[i]->Chr->DesiredFacing; |
595 |
|
data->CosmeticFacing = PlayerList[i]->Chr->CosmeticFacing; |
596 |
+ |
|
597 |
+ |
|
598 |
|
data->Position = Active_Player->PhyContext->Position; |
599 |
|
|
600 |
|
if( PlayerList[i]->OldClass != PlayerList[i]->Chr->ONCC || memcmp( &(PlayerList[i]->Inventory), &(PlayerList[i]->Chr->Inventory), sizeof(Inventory) ) ) |
633 |
|
if(i == 0) { |
634 |
|
data->Inputs.Actions1 = ((GameState*)(ONgGameState))->Input.Current.Actions1; |
635 |
|
data->Inputs.Actions2 = ((GameState*)(ONgGameState))->Input.Current.Actions2; |
636 |
+ |
data->Inputs.MouseDeltaX = ONgGameState->Input.MouseDeltaX; |
637 |
+ |
data->Inputs.MouseDeltaY = ONgGameState->Input.MouseDeltaY; |
638 |
|
} |
639 |
|
else{ |
640 |
|
data->Inputs.Actions1 = PlayerList[i]->Actions1; |
641 |
|
data->Inputs.Actions2 = PlayerList[i]->Actions2; |
642 |
+ |
data->Inputs.MouseDeltaX = PlayerList[i]->MouseDeltaX; |
643 |
+ |
data->Inputs.MouseDeltaY = PlayerList[i]->MouseDeltaY; |
644 |
|
} |
645 |
|
memcpy( &(PlayerList[i]->player_data), data, sizeof(player_data) ); |
646 |
|
|
649 |
|
|
650 |
|
if( (server_started && i !=0) || (!server_started/* && i != client_slot*/) ) |
651 |
|
{ |
652 |
< |
//this just made sync even worse....maybe keystrokes are actually _behind_ |
629 |
< |
// |
630 |
< |
// |
652 |
> |
//this just made sync even worse... |
653 |
|
#ifdef JITTER_FIX |
654 |
|
input_struct * New_Input = &PlayerList[i]->MouseDeltaX; |
655 |
|
input_struct * Cache_Input = &PlayerList[i]->CacheInput; |
677 |
|
Active_Input->Stopped.Actions2 = ~Active_Input->Current.Actions2; |
678 |
|
Active_Input->MouseDeltaX = PlayerList[i]->MouseDeltaX; |
679 |
|
Active_Input->MouseDeltaY = PlayerList[i]->MouseDeltaY; |
680 |
< |
DDrConsole_PrintF("Timer: %i", (Active_Player->SprintTimer != 0) ? (Active_Player->SprintTimer == -1) ? -1 : (ONgGameState->GameTime - Active_Player->SprintTimer) : 0); |
680 |
> |
//DDrConsole_PrintF("Timer: %i", (Active_Player->SprintTimer != 0) ? (Active_Player->SprintTimer == -1) ? -1 : (ONgGameState->GameTime - Active_Player->SprintTimer) : 0); |
681 |
|
|
682 |
|
//DDrConsole_PrintF("1E8 %u", ONgGameState->PlayerCharacter->field_1E8); |
683 |
|
/* |
714 |
|
} |
715 |
|
} |
716 |
|
|
695 |
– |
//Make the current controls match the sent controls, now that we have sent them off and everything is synced. |
696 |
– |
//No, don't do it to the direct input, it breaks stuff. |
697 |
– |
//Need to disable the function that puts game input onto characters because we are doing it directly. |
698 |
– |
/* |
699 |
– |
if( !server_started ) |
700 |
– |
{ |
701 |
– |
ONgGameState->Input.MouseDeltaX = PlayerList[client_slot]->MouseDeltaX; |
702 |
– |
ONgGameState->Input.MouseDeltaY = PlayerList[client_slot]->MouseDeltaY; |
703 |
– |
ONgGameState->Input.Current.Actions1 = PlayerList[client_slot]->Actions1; |
704 |
– |
ONgGameState->Input.Current.Actions2 = PlayerList[client_slot]->Actions2; |
705 |
– |
} |
706 |
– |
*/ |
707 |
– |
|
717 |
|
return ONgGameState; |
718 |
|
} |