Changeset 568
- Timestamp:
- Jun 30, 2010, 6:25:00 AM (14 years ago)
- Location:
- Daodan/MSVC
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/MSVC/Daodan_BSL.c
r567 r568 475 475 else index = args[0].value_int32; 476 476 477 Chr = ONgGameState->CharacterStorage;478 Active = ONrGetActiveCharacter( &Chr[index]);477 Chr = &(ONgGameState->CharacterStorage[index]); 478 Active = ONrGetActiveCharacter(Chr); 479 479 if (!Active) return 1; 480 480 … … 819 819 SLrScript_Command_Register_ReturnType("d_maxhealth","Gets or sets a character's maximum health", "[ai_name:string | script_id:int] [newmaxhealth:int] [scalehealth:bool]", sl_str32, bsl_maxhealth); 820 820 SLrScript_Command_Register_ReturnType("d_powerup","Gets or sets a character's powerups", "[ai_name:string | script_id:int] powerup:string", sl_int32, bsl_powerup); 821 //d_holdkey is broken! 821 822 SLrScript_Command_Register_ReturnType("d_holdkey","Makes a character hold a key", "[ai_name:string | script_id:int] frames:int keys:string", sl_int32, bsl_holdkey); 822 823 SLrScript_Command_Register_ReturnType("d_isheld","Checks if player is holding a key", "[ai_name:string | script_id:int] [keys:string]", sl_int32, bsl_isheld); -
Daodan/MSVC/Flatline.c
r567 r568 15 15 }; 16 16 17 #define BETTER_SYNC 18 19 void DoRareSync( short Player, sockaddr_in * sender ) 20 { 21 flatline_packet sync = {0}; 22 23 if (Player > max_connections || !PlayerList[ Player ] ) return; 24 25 26 // DDrConsole_PrintF( "Sending sync data for player %i, new index %u", Player, PlayerList[ Player ]->rare_sync_index); 27 sender->sin_addr.S_un.S_addr = htonl(sender->sin_addr.S_un.S_addr); 28 sync.id = RARE_SYNC_DATA; 29 sprintf( sync.rare_sync_data.Class, TMrInstance_GetInstanceName( PlayerList[ Player ]->Chr->ONCC ) ); 30 //using ->Inventory instead of ->Chr->Inventory to keep the index and Inventory in sync, just in case. 31 memcpy( &(sync.rare_sync_data.Inventory), &(PlayerList[ Player ]->Inventory), sizeof(Inventory) ); 32 //WEAPONS ARE DISABLED. Why? Pain in the arse to sync. 33 sync.rare_sync_data.Inventory.Weapons[0] = NULL; 34 sync.rare_sync_data.Inventory.Weapons[1] = NULL; 35 sync.rare_sync_data.Inventory.Weapons[2] = NULL; 36 sync.rare_sync_data.PlayerNum = Player; 37 sync.rare_sync_data.index = PlayerList[ Player ]->rare_sync_index; 38 NetTCPServer_Send( sender, (char*)&sync, sizeof(rare_sync_data) + FLATLINE_HEADER ); 39 } 40 17 41 bool FLrServer_PacketCallback(char* data, int datalen, int from) 18 42 { … … 72 96 memset(Char, 0, sizeof(CharacterObject)); 73 97 Char->Header.Type = 'CHAR'; 74 Char->OSD.Options = chr_dontaim | chr_unkillable;98 Char->OSD.Options = chr_dontaim; 75 99 for(j = 0; j < max_connections; j++) { 76 100 if(PlayerList[j] != 0) { … … 170 194 PlayerList[i]->MouseDeltaX = packet_input->MouseDeltaX; 171 195 PlayerList[i]->MouseDeltaY = packet_input->MouseDeltaY; 172 196 PlayerList[i]->LastInputTime = packet_input->Time; 173 197 174 198 break; 175 199 } 200 case RARE_SYNC_DATA_REQUEST: 201 DoRareSync( packet->sync_request , &sender); 202 break; 176 203 default: 177 204 DDrConsole_PrintF("Warning, recieved badly formed packet!"); … … 226 253 227 254 client_slot = ((connect_reply*)packet->data)->player_slot; 255 256 PlayerList[client_slot] = Players+client_slot; 257 PlayerList[client_slot]->Chr = ONgGameState->PlayerCharacter; 258 259 DDrConsole_PrintColored("Connection successful!",0,green, grey); 228 260 229 PlayerList[client_slot] = Players+client_slot; 230 PlayerList[client_slot]->Chr = ONgGameState->PlayerCharacter; 231 232 233 234 DDrConsole_PrintColored("Connection successful!",0,green, grey); 261 //disable local input. 262 DDrPatch_NOOP(0x004FA929, 5 + 6 + 5); 263 235 264 //DDrConsole_PrintF("Slot %i", ((connect_reply*)packet)->player_slot); 236 265 break; … … 322 351 else { 323 352 ONrGameState_NewCharacter(Char, NULL, NULL, &chr_index); 353 ONgGameState->CharacterStorage[chr_index].field_1E8 = 0; 324 354 PlayerList[packet.new_player.Playernumber] = &Players[chr_index]; 325 355 Players[chr_index].Chr = &(ONgGameState->CharacterStorage[chr_index]); 326 356 Players[chr_index].Chr->Flags &= 0xFFBFFFFF; 357 Players[chr_index].spawnnumber = chr_index; 327 358 DDrConsole_PrintF("Spawning player %s, class %s, slot %i", ((new_player*)(packet.data))->Character.OSD.Name, ((new_player*)(packet.data))->Character.OSD.Class,chr_index) ; 328 359 } … … 341 372 if( !PlayerList[i] ) break; 342 373 //PlayerList[i]->Chr = ((GameState *)ONgGameState)->CharacterStorage; 343 374 #ifndef BETTER_SYNC 344 375 PlayerList[i]->Chr->Health = data->Health; 345 376 PlayerList[i]->Chr->MaxHealth = data->MaxHealth; … … 359 390 360 391 Active->PhyContext->Position = data->Position; 392 #else 393 PlayerList[i]->Actions1 = data->Inputs.Actions1; 394 PlayerList[i]->Actions2 = data->Inputs.Actions2; 395 PlayerList[i]->MouseDeltaX = data->Inputs.MouseDeltaX; 396 PlayerList[i]->MouseDeltaY = data->Inputs.MouseDeltaY; 397 memcpy( &(PlayerList[i]->player_data), data, sizeof(player_data) ); 398 #endif 399 if( !server_started && data->rare_sync_index > PlayerList[i]->rare_sync_index ) 400 { 401 int sent_bytes; 402 flatline_packet sync_request = {0}; 403 sync_request.id = RARE_SYNC_DATA_REQUEST; 404 sync_request.sync_request = i; 405 DDrConsole_PrintF( "Requesting sync data for player %i, old index %u", i, PlayerList[i]->rare_sync_index); 406 sent_bytes = NetUDPSocket_Send(client_sock,(sockaddr *) &address, (char*)&sync_request, FLATLINE_HEADER + sizeof(int) ); 407 } 408 361 409 362 410 #if 0 … … 389 437 break; 390 438 } 439 case RARE_SYNC_DATA: 440 if(1) { 441 sl_arg hax[2]; 442 int dontuse; 443 uint16_t i = packet.rare_sync_data.PlayerNum; 444 445 if (i > max_connections) break; 446 if( !PlayerList[i] ) break; 447 448 //WEAPONS ARE DISABLED. Why? Pain in the arse to sync. 449 packet.rare_sync_data.Inventory.Weapons[0] = NULL; 450 packet.rare_sync_data.Inventory.Weapons[1] = NULL; 451 packet.rare_sync_data.Inventory.Weapons[2] = NULL; 452 // TMrInstance_GetDataPtr( 'ONCC', packet.rare_sync_data.Class, PlayerList[ i ]->Chr->ONCC ); 453 454 //add the target character 455 hax[0].type = sl_int32; 456 hax[0].value_int32 = PlayerList[ packet.rare_sync_data.PlayerNum ]->spawnnumber; 457 458 //add the new class 459 //fix this later so we cant buffer overflow :O 460 hax[1].type = sl_str32; 461 hax[1].value_str32 = packet.rare_sync_data.Class; 462 463 //we are directly calling a bsl function instead of using the normal method for two reasons 464 //1. it has all the checking built in 465 iSetCharacterClass( 0, 2, hax, &dontuse, &dontuse, hax ); 466 //DDrConsole_PrintF( "Recieved sync data for player %i, class %s, old index %u, new index %u", i, packet.rare_sync_data.Class, PlayerList[i]->rare_sync_index, packet.rare_sync_data.index); 467 memcpy( &(PlayerList[ i ]->Chr->Inventory), &(packet.rare_sync_data.Inventory), sizeof(Inventory )); 468 469 PlayerList[i]->rare_sync_index = packet.rare_sync_data.index; 470 } 471 break; 472 391 473 default: 392 474 DDrConsole_PrintF("Warning, recieved badly formed packet!"); … … 402 484 } 403 485 404 //UDPServer_SendToAll 405 //Sends a packet to all the clients currently connected. 406 //Returns the number of players sent to. 407 int UDPServer_SendToAll(void* packet, int size) { 408 int j; 409 int players = 0; 410 sockaddr_in address; 411 memset(&address, 0, sizeof(sockaddr_in)); 412 address.sin_family = AF_INET; 413 address.sin_addr.s_addr = htonl(INADDR_ANY); 414 address.sin_port = htons(27777); 415 for(j = 0; j < max_connections; j++) { 416 if (PlayerList[j] != 0 && PlayerList[j]->ip && (PlayerList[j]->ip != inet_addr("127.0.0.1"))) { 417 int sent_bytes; 418 address.sin_addr.s_addr = htonl(PlayerList[j]->ip);//*((struct in_addr*)(int*)&(Players[j].ip)); 419 sent_bytes = NetUDPServer_Send((sockaddr *) &address, (char*)packet, size); 420 if(sent_bytes == SOCKET_ERROR) NetCatchError(); 421 else players++; 422 } 423 } 424 return players; 425 } 426 486 //wtf, this needs cleaned up... 427 487 player_info *FLr_FindEmptySlot() { 428 488 int j; … … 450 510 void * ONICALL FLrInput_Update_Keys(void) 451 511 { 452 uint16_t i; 512 uint16_t i; 513 /*DDrConsole_PrintF("Current: %x %x | Start: %x %x | Stop: %x %x | Stopped %x %x", 514 ONgGameState->Input.Current.Actions1, ONgGameState->Input.Current.Actions2, 515 ONgGameState->Input.Start.Actions1,ONgGameState->Input.Start.Actions2, 516 ONgGameState->Input.Stop.Actions1, ONgGameState->Input.Stop.Actions2, 517 ONgGameState->Input.Stopped.Actions2, ONgGameState->Input.Stopped.Actions2 518 ); 519 */ 520 ActiveCharacter * Active_Player = ONgGameState->ActiveCharacters; 521 522 //if sprint timer is equal to 0, display 0 523 //else if sprint timer is equal to -1, display -1 524 //else display difference 525 //good thing this is just quick an dirty debug stuff :) 526 527 //basically it seems that if the difference is bigger than 15 frames, you cant dash. : / 528 453 529 #ifndef SPAM_INPUT 454 530 if(client_connected) … … 457 533 flatline_packet input_packet = {0}; 458 534 input_packet.id = PLAYER_INPUT; 459 535 input_packet.input_struct.Time = ONgGameState->GameTime; 460 536 input_packet.input_struct.Actions1 = ((GameState*)(ONgGameState))->Input.Current.Actions1; 461 537 input_packet.input_struct.Actions2 = ((GameState*)(ONgGameState))->Input.Current.Actions2; … … 469 545 #endif 470 546 //Testing drawing text to the screen...this failed. Will need to get it working eventually. 471 if( TSrTest ) 547 if( TSrTest ) 472 548 { 473 549 OniRectangle TextRect = { 20, 20, 50, 50 }; … … 481 557 if(PlayerList[i] == 0) continue; 482 558 483 Active_Player = (void*)ONrGetActiveCharacter(PlayerList[i]->Chr); 559 //is this right? 560 Active_Player = (void*)ONrGetActiveCharacter( PlayerList[i]->Chr); 484 561 485 562 if(Active_Player == 0) continue; … … 499 576 data->DesiredFacing = PlayerList[i]->Chr->DesiredFacing; 500 577 data->CosmeticFacing = PlayerList[i]->Chr->CosmeticFacing; 578 data->Position = Active_Player->PhyContext->Position; 579 580 if( PlayerList[i]->OldClass != PlayerList[i]->Chr->ONCC || memcmp( &(PlayerList[i]->Inventory), &(PlayerList[i]->Chr->Inventory), sizeof(Inventory) ) ) 581 { 582 PlayerList[i]->OldClass = PlayerList[i]->Chr->ONCC; 583 memcpy( &(PlayerList[i]->Inventory), &(PlayerList[i]->Chr->Inventory), sizeof(Inventory) ); 584 PlayerList[i]->rare_sync_index++; 585 586 } 587 588 data->rare_sync_index = PlayerList[i]->rare_sync_index; 501 589 502 590 #if 0 … … 531 619 data->Inputs.Actions2 = PlayerList[i]->Actions2; 532 620 } 621 memcpy( &(PlayerList[i]->player_data), data, sizeof(player_data) ); 622 533 623 UDPServer_SendToAll(&data_out, sizeof(player_data) + FLATLINE_HEADER); 534 624 } 535 625 536 if( (server_started && i !=0) || (!server_started && i != client_slot)) { 626 if( (server_started && i !=0) || (!server_started/* && i != client_slot*/) ) 627 { 628 //this just made sync even worse....maybe keystrokes are actually _behind_ 629 // 630 // 631 #ifdef JITTER_FIX 632 input_struct * New_Input = &PlayerList[i]->MouseDeltaX; 633 input_struct * Cache_Input = &PlayerList[i]->CacheInput; 634 Active_Input->Stop.Actions1 = ~Cache_Input->Actions1 & Active_Input->Current.Actions1; 635 Active_Input->Stop.Actions2 = ~Cache_Input->Actions2 & Active_Input->Current.Actions2; 636 Active_Input->Start.Actions1 = ~Active_Input->Current.Actions1 & Cache_Input->Actions1; 637 Active_Input->Start.Actions2 = ~Active_Input->Current.Actions2 & Cache_Input->Actions2; 638 Active_Input->Current.Actions1 = Cache_Input->Actions1; 639 Active_Input->Current.Actions2 = Cache_Input->Actions2; 640 Active_Input->Stopped.Actions1 = ~Active_Input->Current.Actions1; 641 Active_Input->Stopped.Actions2 = ~Active_Input->Current.Actions2; 642 Active_Input->MouseDeltaX = Cache_Input->MouseDeltaX; 643 Active_Input->MouseDeltaY = Cache_Input->MouseDeltaY; 644 memcpy( Cache_Input, New_Input, sizeof(input_struct)); 645 #else 646 537 647 Active_Input->Stop.Actions1 = ~PlayerList[i]->Actions1 & Active_Input->Current.Actions1; 538 648 Active_Input->Stop.Actions2 = ~PlayerList[i]->Actions2 & Active_Input->Current.Actions2; 539 649 Active_Input->Start.Actions1 = ~Active_Input->Current.Actions1 & PlayerList[i]->Actions1; 540 650 Active_Input->Start.Actions2 = ~Active_Input->Current.Actions2 & PlayerList[i]->Actions2; 651 541 652 Active_Input->Current.Actions1 = PlayerList[i]->Actions1; 542 653 Active_Input->Current.Actions2 = PlayerList[i]->Actions2; … … 545 656 Active_Input->MouseDeltaX = PlayerList[i]->MouseDeltaX; 546 657 Active_Input->MouseDeltaY = PlayerList[i]->MouseDeltaY; 658 DDrConsole_PrintF("Timer: %i", (Active_Player->SprintTimer != 0) ? (Active_Player->SprintTimer == -1) ? -1 : (ONgGameState->GameTime - Active_Player->SprintTimer) : 0); 659 660 //DDrConsole_PrintF("1E8 %u", ONgGameState->PlayerCharacter->field_1E8); 661 /* 662 DDrConsole_PrintF("T %u | Current: %x %x | Start: %x %x | Stop: %x %x | Stopped %x %x", 663 PlayerList[i]->LastInputTime, 664 Active_Input->Current.Actions1, Active_Input->Current.Actions2, 665 Active_Input->Start.Actions1,Active_Input->Start.Actions2, 666 Active_Input->Stop.Actions1, Active_Input->Stop.Actions2, 667 Active_Input->Stopped.Actions1, Active_Input->Stopped.Actions2 668 ); 669 */ 670 671 672 #endif 673 674 #ifdef BETTER_SYNC 675 if( !server_started && PlayerList[i]->player_data.Health != 0) { 676 PlayerList[i]->Chr->Health = PlayerList[i]->player_data.Health; 677 PlayerList[i]->Chr->MaxHealth = PlayerList[i]->player_data.MaxHealth; 678 PlayerList[i]->Chr->Position = PlayerList[i]->player_data.Position; 679 PlayerList[i]->Chr->Location = PlayerList[i]->player_data.Location; 680 PlayerList[i]->Chr->LastPosition = PlayerList[i]->player_data.LastPosition; 681 PlayerList[i]->Chr->Facing = PlayerList[i]->player_data.Facing; 682 PlayerList[i]->Chr->DesiredFacing = PlayerList[i]->player_data.DesiredFacing; 683 PlayerList[i]->Chr->CosmeticFacing = PlayerList[i]->player_data.CosmeticFacing; 684 PlayerList[i]->Actions1 = PlayerList[i]->player_data.Inputs.Actions1; 685 PlayerList[i]->Actions2 = PlayerList[i]->player_data.Inputs.Actions2; 686 PlayerList[i]->MouseDeltaX = PlayerList[i]->player_data.Inputs.MouseDeltaX; 687 PlayerList[i]->MouseDeltaY = PlayerList[i]->player_data.Inputs.MouseDeltaY; 688 Active_Player->PhyContext->Position = PlayerList[i]->player_data.Position; 689 } 690 #endif 691 547 692 } 548 693 } 694 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 549 708 return ONgGameState; 550 709 } -
Daodan/MSVC/Flatline.h
r567 r568 65 65 DWORD WINAPI StartClient(void* lol); 66 66 67 //oh snap, I just realized this is rossy's version of flatline_packet. :|68 typedef struct {69 char signature[8];70 uint16_t protocol_version;71 char data[0]; //data[0] doesn't work well with simple casts, btw. If you allocate enough space for a handshake_packet72 } handshake_packet; //there won't be enough room for data. You would have to manually manage the memory (ew)73 67 74 68 //initial connection … … 98 92 } new_player; 99 93 100 extern int update_rate;94 //extern int update_rate; 101 95 102 96 typedef struct { … … 105 99 uint32_t Actions1; 106 100 uint32_t Actions2; 101 unsigned int Time; 107 102 } input_struct; 108 103 … … 123 118 uint32_t MaxHealth; 124 119 input_struct Inputs; 120 int rare_sync_index; 121 //__int16 Varient; 125 122 #if 0 126 123 uint16_t Frame; … … 144 141 } player_data; 145 142 143 //todo, move health in... 144 typedef struct { 145 short unsigned int PlayerNum; 146 unsigned int index; 147 Inventory Inventory; 148 char Class[32]; 149 } rare_sync_data; 150 146 151 //used for storing data about each player 147 152 typedef struct { … … 158 163 server_status server_status; 159 164 player_data player_data; 165 rare_sync_data rare_sync_data; 166 uint16_t sync_request; 160 167 }; 161 168 } flatline_packet; 162 #define FLATLINE_HEADER sizeof(flatline_packet)-sizeof(char)*1080169 #define FLATLINE_HEADER (sizeof(flatline_packet)-sizeof(char)*1080) 163 170 //#define FLATLINE_PACKET_SIZE sizeof(flatline_packet) 164 171 … … 179 186 PLAYER_INPUT, 180 187 PLAYER_DATA, 188 RARE_SYNC_DATA, 189 RARE_SYNC_DATA_REQUEST, 181 190 }; 182 191 … … 184 193 typedef struct { 185 194 int ip; 186 char name[32]; 195 char name[32]; 187 196 char country[2]; 188 197 Character* Chr; 189 198 uint16_t spawnnumber; 190 199 uint16_t list_slot; 200 201 float MouseDeltaX; 202 float MouseDeltaY; 191 203 uint32_t Actions1; 192 204 uint32_t Actions2; 193 float MouseDeltaX; 194 float MouseDeltaY; 205 unsigned int LastInputTime; 206 input_struct CacheInput; 207 208 player_data player_data; 209 210 unsigned int rare_sync_index; 211 void* OldClass; 212 Inventory Inventory; 195 213 } player_info; 196 214 -
Daodan/MSVC/Flatline_BSL.c
r567 r568 114 114 return 0; 115 115 } 116 117 116 uint16_t ONICALL addfake(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret) 117 { 118 player_info * info; 119 info = FLrServer_AddPlayer( 0, "Fake", 0 ); 120 info->Actions1 = Action_Forward; 121 return 0; 122 } 118 123 void SLrFlatline_Initialize() { 119 124 120 DDrPatch_MakeCall(OniExe + 0x000FA88B, FLrInput_Update_Keys); 125 DDrPatch_MakeCall(0x004FA88B, FLrInput_Update_Keys); 126 121 127 SLrGlobalVariable_Register_Int32("skip", "skips", &(((GameState*)ONgGameState)->field_40) ); 122 128 SLrScript_Command_Register_ReturnType("connect","Connects to a server", "ip:string", sl_void, connect_to_server); 123 129 SLrScript_Command_Register_Void("host","Starts a server", "", start_server); 124 130 SLrScript_Command_Register_Void("msg","Sends a message", "", send_message); 125 SLrScript_Command_Register_ Void("name","changes your name", "name:str", change_name);131 SLrScript_Command_Register_ReturnType("name","changes your name", "name:str", sl_void, change_name); 126 132 SLrScript_Command_Register_Void("status","shows the connection status", "", status); 127 133 SLrGlobalVariable_Register_String("country", "Your Multiplayer country", player_name); 128 134 SLrScript_Command_Register_ReturnType("addfakeclient","adds a fake client", "", sl_void, addfake); 129 135 } -
Daodan/MSVC/Flatline_Server.c
r567 r568 53 53 if(!is_server) { 54 54 ONrGameState_NewCharacter(Char, NULL, NULL, &(player_slot)); 55 //move this to a set up characters function... 56 ONgGameState->CharacterStorage[player_slot].field_1E8 = 0; 57 55 58 PlayerList[playerlist_slot] = Players+player_slot; 59 PlayerList[playerlist_slot]->spawnnumber = player_slot; 56 60 PlayerList[playerlist_slot]->Chr = &((Character *)(((GameState * )(ONgGameState))->CharacterStorage))[player_slot]; 57 PlayerList[playerlist_slot]->Chr->Flags = chr_dontaim | chr_unkillable; //&= 0xFFBFFFFF; //WTF 61 // PlayerList[playerlist_slot]->Chr->Flags = chr_dontaim | chr_unkillable; //&= 0xFFBFFFFF; //WTF 62 PlayerList[playerlist_slot]->Chr->Flags &= 0xFFBFFFFF; //WTF 58 63 sprintf(PlayerList[playerlist_slot]->Chr->Name, "%.31s", name); 59 64 UDPServer_SendToAll( (char*)&new_char, sizeof(new_player) + FLATLINE_HEADER ); … … 78 83 void FLrServer_Initialize(){ 79 84 FLrServer_AddPlayer(inet_addr("127.0.0.1"), "host", 1); 85 } 80 86 81 87 //UDPServer_SendToAll 88 //Sends a packet to all the clients currently connected. 89 //Returns the number of players sent to. 90 int UDPServer_SendToAll(void* packet, int size) { 91 int j; 92 int players = 0; 93 sockaddr_in address; 94 memset(&address, 0, sizeof(sockaddr_in)); 95 address.sin_family = AF_INET; 96 address.sin_addr.s_addr = htonl(INADDR_ANY); 97 address.sin_port = htons(27777); 98 for(j = 0; j < max_connections; j++) { 99 if (PlayerList[j] != 0 && PlayerList[j]->ip && (PlayerList[j]->ip != inet_addr("127.0.0.1"))) { 100 int sent_bytes; 101 address.sin_addr.s_addr = htonl(PlayerList[j]->ip);//*((struct in_addr*)(int*)&(Players[j].ip)); 102 sent_bytes = NetUDPServer_Send((sockaddr *) &address, (char*)packet, size); 103 if(sent_bytes == SOCKET_ERROR) NetCatchError(); 104 else players++; 105 } 106 } 107 return players; 82 108 } -
Daodan/MSVC/Oni_GameState.h
r567 r568 479 479 } AttachedParticle; 480 480 481 482 typedef struct 483 { 484 __int16 Index; 485 __int16 Flags; 486 int Class; 487 int Character; 488 Matrix4x3 Matrix; 489 int PhyContext; 490 int Facing; 491 __int16 FadeTimer; 492 __int16 TimeToFade; 493 int CreationTime; 494 __int16 ShotDelay1; 495 __int16 ShotDelay2; 496 __int16 PauseBeforeReload; 497 __int16 PauseAfterReload; 498 __int16 ActiveFireModeLength; 499 __int16 AmmoCount; 500 __int16 field_58; 501 __int16 FiringDelays[16]; 502 char gap_7a[2]; 503 int ParticleInstances[16]; 504 int field_BC[16]; 505 int field_FC; 506 int DodgeFiringSpreadPtr; 507 int field_104; 508 int field_108; 509 int field_10C; 510 char gap_110[20]; 511 Vector3 Center; 512 int NodeList[16]; 513 } Weapon; 514 481 515 typedef struct { //Inventory 482 int32_tWeapons[3];516 Weapon* Weapons[3]; 483 517 int16_t field_1A0; //10 bucks says this is the current weapon 484 518 int16_t AmmoUsed; //Ammo given for the char to use -
Daodan/MSVC/Oni_Symbols.c
r567 r568 141 141 DefFunc( ONrPlatform_Initialize , 0x0050f670 ); 142 142 DefFunc( ONrPlatform_WindowProc , 0x0050f7a0 ); 143 DefFunc( iSetCharacterClass , 0x004D99D0 ); 144 143 145 144 146 DefFunc( SLrGlobalVariable_Register_Int32 , 0x0477e30); -
Daodan/MSVC/Oni_Symbols.h
r567 r568 113 113 typedef int16_t ( *_TSrContext_New)( void* FontInstance, int size, int hthsik1,int hthsik2,int hthsik3, void* TSrContext); 114 114 115 //yes im cheating so badly. 116 typedef uint16_t ( *_iSetCharacterClass)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret); 115 117 116 118 #define ExtFunc(name) extern _##name name … … 151 153 ExtFunc(ONrGetActiveCharacter); 152 154 155 ExtFunc(iSetCharacterClass); 156 153 157 ExtFunc(COrTextArea_Print); 154 158
Note:
See TracChangeset
for help on using the changeset viewer.