- Timestamp:
- Jan 12, 2011, 7:47:16 PM (14 years ago)
- Location:
- Daodan/MSVC
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/MSVC/Daodan_Utility.c
r574 r578 175 175 } 176 176 } 177 178 void* ScoreboardInstance = 0; 179 void FLrRun_Scores() 180 { 181 182 if(!ScoreboardInstance){ 183 void* TSFFTahoma; 184 TMrInstance_GetDataPtr( 'TSFF', "Tahoma", &TSFFTahoma); 185 TSrContext_New( TSFFTahoma, 7, 1, 1, 0, &ScoreboardInstance); 186 } 187 if(ScoreboardInstance){ 188 int white = 0x00FFFFFF; 189 IMtPoint2D DrawLocation = {20, 20}; 190 TSrContext_SetShade(ScoreboardInstance, white); 191 TSrContext_DrawText(ScoreboardInstance, "Scores and crap", 255, 0, &DrawLocation); 192 } 193 } 194 177 195 void ONICALL DDrText_Hook() 178 196 { -
Daodan/MSVC/Flatline.h
r574 r578 82 82 83 83 //um, status of the server? :/ 84 //probably obsolete. revive again once i do something crazy 85 //like make a master server 84 86 typedef struct { 85 87 char name[256]; … … 194 196 EV_MAX, 195 197 }; 196 197 198 198 199 -
Daodan/MSVC/Flatline_BSL.c
r574 r578 98 98 j, 99 99 PlayerList[j]->name, 100 (inet_ntoa(*( (struct in_addr*)(int*)&(PlayerList[j]->ip ) ))));100 inet_ntoa(*( (struct in_addr*)(int*)&(PlayerList[j]->ip ) ))); 101 101 } 102 102 } -
Daodan/MSVC/Flatline_Server.c
r574 r578 1 1 #include "Flatline.h" 2 2 #include "Flatline_Server.h" 3 4 //I hereby apologize for the uglyness of the below code. 5 //It was never intended to be "final" code, much less shared with anyone 3 6 4 7 int total_players = 0; … … 10 13 uint32_t player_slot = 0; 11 14 int playerlist_slot = 0; 12 if(is_server) goto server;13 if( total_players < max_connections) {14 char* zero = strchr(name, 0);15 16 if(is_server || total_players < max_connections) { 17 15 18 int i = 0; 16 19 int k = 0; 17 playerlist_slot = FLr_FindEmptyListSlot();18 19 20 20 total_players++; 21 //Skip for the host 22 if(!is_server) 23 { 24 char* zero = strchr(name, 0); 25 playerlist_slot = FLr_FindEmptyListSlot(); 21 26 22 //send new player packet to all players 23 //char tempname[32] = {0}; 27 total_players++; 24 28 25 //checks to see if a name exists or not 26 //then appends [#] on the end of it if it does 27 28 if(zero - name > 28) zero = name + 28; 29 for(i = 0; i < max_connections; i++) { 30 if(PlayerList[i] != 0 && !strcmp(name, PlayerList[i]->name)) { 31 k++; 32 sprintf(zero, "[%i]", k); 33 i = 0; 29 //checks to see if a name exists or not 30 //then appends [#] on the end of it if it does 31 //May be buggy, come back to this. 32 if(zero - name > 28) zero = name + 28; 33 for(i = 0; i < max_connections; i++) { 34 if(PlayerList[i] != 0 && !strcmp(name, PlayerList[i]->name)) { 35 k++; 36 sprintf(zero, "[%i]", k); 37 i = 0; 38 } 34 39 } 35 40 } 41 42 new_char.new_player.Playernumber = playerlist_slot; 36 43 37 server: ; 38 //memset( new_char, 0, sizeof(new_char); 39 //new_char = {0}; 40 new_char.new_player.Playernumber = playerlist_slot; 44 //Set up a new Character structure to be spawned as the new player. 45 //Can this code be surrounded with if(!is_server){}? 41 46 Char = &new_char.new_player.Character; 42 47 memset(Char, 0, sizeof(CharacterObject)); 43 48 Char->Header.Type = 'CHAR'; 44 //Char->OSD.Options = char_dontaim;45 49 sprintf(Char->OSD.Name,"%s",name); 46 50 sprintf(Char->OSD.Class, "%s", "konoko_generic"); … … 61 65 62 66 //TMrInstance_GetDataPtr('ONCC', "striker_easy_1", PlayerList[playerlist_slot]->Chr->ONCC); 63 64 67 65 68 new_char.id = NEW_PLAYER; … … 71 74 PlayerList[playerlist_slot] = Players+player_slot; 72 75 PlayerList[playerlist_slot]->spawnnumber = player_slot; 73 PlayerList[playerlist_slot]->Chr = &( (Character *)(((GameState * )(ONgGameState))->CharacterStorage))[player_slot];74 //PlayerList[playerlist_slot]->Chr->Flags = chr_dontaim | chr_unkillable; //&= 0xFFBFFFFF; //WTF75 if(!is_bot) PlayerList[playerlist_slot]->Chr->Flags &= 0xFFBFFFFF; //WTF 76 PlayerList[playerlist_slot]->Chr = &(ONgGameState->CharacterStorage)[player_slot]; 77 //PlayerList[playerlist_slot]->Chr->Flags = chr_dontaim | chr_unkillable; //&= 0xFFBFFFFF; //WTF 78 if(!is_bot) PlayerList[playerlist_slot]->Chr->Flags &= 0xFFBFFFFF; //WTF, magic number. 76 79 sprintf(PlayerList[playerlist_slot]->Chr->Name, "%.31s", name); 77 80 UDPServer_SendToAll( (char*)&new_char, sizeof(new_player) + FLATLINE_HEADER ); … … 121 124 } 122 125 126 //Sends an event (door opening, player disconnecting, etc) to all players 123 127 //Always make sure you send a pointer to this, even if it is just one arg. ;) 124 128 void FLsPublic_Event( unsigned int eventIndex, int * args ) … … 132 136 } 133 137 138 void PlayerDisconnect( int Player ) 139 { 140 FLsPublic_Event(EV_DISCONNECT, &Player ); 141 memset(PlayerList[Player], 0, sizeof(player_info)); 142 return; 143 } -
Daodan/MSVC/Oni_GameState.h
r574 r578 1183 1183 __int16 AnimationType; 1184 1184 __int16 NextAnimationType; 1185 __int16 field_1B04;1185 __int16 PrevAnimationType; 1186 1186 __int16 field_1B06; 1187 1187 char Stitch; -
Daodan/MSVC/Oni_Symbols.c
r574 r578 183 183 //DefFunc( OBJrConsole_GetByID , 0x004C0950 ); 184 184 DefFunc( OBJrConsole_OnActivate , 0x004C0880 ); 185 185 DefFunc( ONrCharacter_SetAnimationExternal , 0x004EB340 ); 186 186 #define DefVar(type, name, address) //type* _##name = (type*)address 187 187 -
Daodan/MSVC/Oni_Symbols.h
r574 r578 95 95 typedef ActiveCharacter* ( *_ONrGetActiveCharacter)(void* CharacterPtr); 96 96 typedef void ( *_ONrCharacter_NewAnimationHook)(Character *ioCharacter, ActiveCharacter *ioActiveCharacter); 97 //int16_t ONICALL ONrGameState_GetPlayerCharacter();97 typedef void ( *_ONrCharacter_SetAnimationExternal)(Character *ioCharacter, short state, void* animation, int interpolation); 98 98 99 99 typedef void ( *_COrTextArea_Print)(uint32_t area, uint32_t priority, … … 117 117 typedef char* ( *_TMrInstance_GetInstanceName)(void* InstancePointer); 118 118 119 typedef int16_t ( *_TSrContext_DrawText)(uint32_t TSrContext, char* Text, intalpha, uint32_t usuallyzero, void* pRect);119 typedef int16_t ( *_TSrContext_DrawText)(uint32_t TSrContext, char* Text, char alpha, uint32_t usuallyzero, void* pRect); 120 120 //int16_t TSrContext_New ( TSFF*, size 7, ??? 1, ??? 1, ??? 0, TSrContext*); 121 121 typedef int16_t ( *_TSrContext_New)( void* FontInstance, int size, int hthsik1,int hthsik2,int hthsik3, void* TSrContext); … … 125 125 uint32_t inShade); 126 126 127 typedef uint16_t ( *_TRrAnimation_GetDuration)( intAnimation);128 typedef uint16_t ( *_TRrAnimation_GetTo)( intAnimation);129 typedef uint16_t ( *_TRrAnimation_GetFrom)( intAnimation);127 typedef uint16_t ( *_TRrAnimation_GetDuration)(void* Animation); 128 typedef uint16_t ( *_TRrAnimation_GetTo)(void* Animation); 129 typedef uint16_t ( *_TRrAnimation_GetFrom)(void* Animation); 130 130 131 131 typedef void … … 197 197 ExtFunc(UUrStartupMessage); 198 198 199 ExtFunc(ONrCharacter_SetAnimationExternal); 200 199 201 ExtFunc(ONrCharacter_NewAnimationHook); 200 202 ExtFunc(ONrCharacter_SetHitPoints); -
Daodan/MSVC/startup.txt
r575 r578 1 1 daodan attached! 2 parsing daodan.ini... 2 3 finished parsing 3 4 parsing command line...
Note:
See TracChangeset
for help on using the changeset viewer.