Changeset 578 for Daodan


Ignore:
Timestamp:
Jan 12, 2011, 7:47:16 PM (14 years ago)
Author:
gumby
Message:
 
Location:
Daodan/MSVC
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • Daodan/MSVC/Daodan_Utility.c

    r574 r578  
    175175        }
    176176}
     177
     178void* ScoreboardInstance = 0;
     179void 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
    177195void ONICALL DDrText_Hook()
    178196{
  • Daodan/MSVC/Flatline.h

    r574 r578  
    8282
    8383//um, status of the server? :/
     84//probably obsolete. revive again once i do something crazy
     85//like make a master server
    8486typedef struct {
    8587        char name[256];
     
    194196        EV_MAX,
    195197};
    196 
    197198
    198199
  • Daodan/MSVC/Flatline_BSL.c

    r574 r578  
    9898                                        j,
    9999                                        PlayerList[j]->name,
    100                                         (inet_ntoa(*( (struct in_addr*)(int*)&(PlayerList[j]->ip )   ))));
     100                                        inet_ntoa(*( (struct in_addr*)(int*)&(PlayerList[j]->ip )   )));
    101101                        }
    102102                }
  • Daodan/MSVC/Flatline_Server.c

    r574 r578  
    11#include "Flatline.h"
    22#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
    36
    47int total_players = 0;
     
    1013        uint32_t player_slot = 0;
    1114        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               
    1518                int i = 0;
    1619                int k = 0;
    17                 playerlist_slot = FLr_FindEmptyListSlot();
    18                
    1920
    20                 total_players++;
     21                //Skip for the host
     22                if(!is_server)
     23                {
     24                        char* zero = strchr(name, 0);
     25                        playerlist_slot = FLr_FindEmptyListSlot();
    2126
    22                 //send new player packet to all players
    23                 //char tempname[32] = {0};
     27                        total_players++;
    2428
    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                                }
    3439                        }
    3540                }
     41               
     42                new_char.new_player.Playernumber = playerlist_slot;
    3643
    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){}?
    4146                Char = &new_char.new_player.Character;
    4247                memset(Char, 0, sizeof(CharacterObject));
    4348                Char->Header.Type = 'CHAR';
    44                 //Char->OSD.Options = char_dontaim;
    4549                sprintf(Char->OSD.Name,"%s",name);
    4650                sprintf(Char->OSD.Class, "%s", "konoko_generic");
     
    6165               
    6266                //TMrInstance_GetDataPtr('ONCC', "striker_easy_1", PlayerList[playerlist_slot]->Chr->ONCC);
    63                
    6467
    6568                new_char.id = NEW_PLAYER;
     
    7174                        PlayerList[playerlist_slot] = Players+player_slot;
    7275                        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; //WTF
    75                         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.
    7679                        sprintf(PlayerList[playerlist_slot]->Chr->Name, "%.31s", name);         
    7780                        UDPServer_SendToAll( (char*)&new_char, sizeof(new_player) + FLATLINE_HEADER );
     
    121124}
    122125
     126//Sends an event (door opening, player disconnecting, etc) to all players
    123127//Always make sure you send a pointer to this, even if it is just one arg. ;)
    124128void FLsPublic_Event( unsigned int eventIndex, int * args )
     
    132136}
    133137
     138void 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  
    11831183  __int16 AnimationType;
    11841184  __int16 NextAnimationType;
    1185   __int16 field_1B04;
     1185  __int16 PrevAnimationType;
    11861186  __int16 field_1B06;
    11871187  char Stitch;
  • Daodan/MSVC/Oni_Symbols.c

    r574 r578  
    183183//DefFunc( OBJrConsole_GetByID                                  , 0x004C0950 );
    184184DefFunc( OBJrConsole_OnActivate                                 , 0x004C0880 );
    185 
     185DefFunc( ONrCharacter_SetAnimationExternal              , 0x004EB340 );
    186186#define DefVar(type, name, address) //type* _##name = (type*)address
    187187
  • Daodan/MSVC/Oni_Symbols.h

    r574 r578  
    9595typedef ActiveCharacter*        ( *_ONrGetActiveCharacter)(void* CharacterPtr);
    9696typedef void ( *_ONrCharacter_NewAnimationHook)(Character *ioCharacter, ActiveCharacter *ioActiveCharacter);
    97 //int16_t ONICALL ONrGameState_GetPlayerCharacter();
     97typedef void ( *_ONrCharacter_SetAnimationExternal)(Character *ioCharacter, short state, void* animation, int interpolation);
    9898
    9999typedef void            ( *_COrTextArea_Print)(uint32_t area, uint32_t priority,
     
    117117typedef char*   ( *_TMrInstance_GetInstanceName)(void* InstancePointer);
    118118
    119 typedef int16_t ( *_TSrContext_DrawText)(uint32_t TSrContext, char* Text, int alpha, uint32_t usuallyzero, void* pRect);
     119typedef int16_t ( *_TSrContext_DrawText)(uint32_t TSrContext, char* Text, char alpha, uint32_t usuallyzero, void* pRect);
    120120//int16_t TSrContext_New        ( TSFF*, size 7, ??? 1, ??? 1, ??? 0, TSrContext*);
    121121typedef int16_t ( *_TSrContext_New)( void* FontInstance, int size, int hthsik1,int hthsik2,int hthsik3, void* TSrContext);
     
    125125        uint32_t        inShade);
    126126
    127 typedef uint16_t ( *_TRrAnimation_GetDuration)(int Animation);
    128 typedef uint16_t ( *_TRrAnimation_GetTo)(int Animation);
    129 typedef uint16_t ( *_TRrAnimation_GetFrom)(int Animation);
     127typedef uint16_t ( *_TRrAnimation_GetDuration)(void* Animation);
     128typedef uint16_t ( *_TRrAnimation_GetTo)(void* Animation);
     129typedef uint16_t ( *_TRrAnimation_GetFrom)(void* Animation);
    130130
    131131typedef void
     
    197197ExtFunc(UUrStartupMessage);
    198198
     199ExtFunc(ONrCharacter_SetAnimationExternal);
     200
    199201ExtFunc(ONrCharacter_NewAnimationHook);
    200202ExtFunc(ONrCharacter_SetHitPoints);
  • Daodan/MSVC/startup.txt

    r575 r578  
    11daodan attached!
     2parsing daodan.ini...
    23finished parsing
    34parsing command line...
Note: See TracChangeset for help on using the changeset viewer.