Changeset 877
- Timestamp:
- Jun 2, 2013, 1:25:34 PM (11 years ago)
- Location:
- Daodan
- Files:
-
- 1 added
- 5 edited
- 24 moved
Legend:
- Unmodified
- Added
- Removed
-
Daodan/makefile
r876 r877 1 FOLDERS = patches flatline 2 FILES = Daodan.c Daodan_BSL.c Daodan_Character.c Daodan_Cheater.c Daodan_Config.c Daodan_Console.c Daodan_GL.c Daodan_Patch.c Daodan_Persistence.c Daodan_Utility.c Daodan_Win32.c Inifile_Reader.c _DLLInfo.rc patches/Patches.c flatline/Flatline.c flatline/Flatline_BSL.c flatline/Flatline_Client.c flatline/Flatline_Hooks.c flatline/Flatline_Net.c flatline/Flatline_Packet.c flatline/Flatline_PacketReader.c flatline/Flatline_PacketBuilder.c flatline/Flatline_Server.c flatline/Flatline_Win32.c flatline/Mariusnet.c flatline/Flatline_Events.c 3 4 DEF = 5 GCCFLAGS = -std=c99 -O0 -Wall -fomit-frame-pointer -fpack-struct -Wextra -Wno-unused-variable -Wno-unused-parameter $(addprefix -D,$(DEF)) 6 LINKFLAGS = -O0 -Wall -fomit-frame-pointer -fpack-struct -s -mdll 7 LOCALE = LC_MESSAGES=C 8 9 #LIBS = -lwinmm -lopengl32 10 LIBS = -lgdi32 -lwsock32 11 OBJS = src/binkw32.def 12 OUT = build/binkw32.dll 13 14 15 ################################################### 16 # # 17 # Should not be required to change anything below # 18 # # 19 ################################################### 20 1 21 UNAME := $(shell uname -s) 2 22 ifeq ("Linux","$(UNAME)") … … 8 28 endif 9 29 10 DEF = NOFLATLINE 11 GCCFLAGS = -std=c99 -O0 -Wall -fomit-frame-pointer -fpack-struct -Wextra -Wno-unused-variable -Wno-unused-parameter -D $(DEF) 12 LINKFLAGS = -O0 -Wall -fomit-frame-pointer -fpack-struct -s -mdll 13 LOCALE = LC_MESSAGES=C 14 15 #LIBS = -lwinmm -lopengl32 -lgdi32 16 LIBS = -lgdi32 -lwsock32 17 OBJS = src/binkw32.def 18 OUT = build/binkw32.dll 19 20 FOLDERS = patches 21 SRC = src/Daodan.c src/Daodan_BSL.c src/Daodan_Character.c src/Daodan_Cheater.c src/Daodan_Config.c src/Daodan_Console.c src/Daodan_GL.c src/Daodan_Patch.c src/Daodan_Persistence.c src/Daodan_Utility.c src/Daodan_Win32.c src/Inifile_Reader.c src/_DLLInfo.rc src/patches/Patches.c src/Flatline.c src/Flatline_BSL.c src/Flatline_Client.c src/Flatline_Hooks.c src/Flatline_Net.c src/Flatline_Packet.c src/Flatline_PacketReader.c src/Flatline_PacketBuilder.c src/Flatline_Server.c src/Flatline_Win32.c src/Mariusnet.c src/Flatline_Events.c 30 DESTFOLDERS = $(addprefix build/,$(FOLDERS)) 31 SRC = $(addprefix src/,$(FILES)) 22 32 DEST = $(patsubst src/%.rc,build/%.o,$(patsubst src/%.c,build/%.o,$(SRC))) 23 33 24 25 ALL: $(FOLDERS) $(DEST) $(OBJS) 34 ALL: $(DESTFOLDERS) $(DEST) $(OBJS) 26 35 @echo "Linking" 27 36 $(LOCALE) $(GCC) $(LINKFLAGS) -o $(OUT) $(DEST) $(OBJS) $(LIBS) … … 29 38 clean: 30 39 rm $(DEST) 31 rm -R $( FOLDERS)40 rm -R $(DESTFOLDERS) 32 41 rm $(OUT) 33 42 34 $( FOLDERS):35 mkdir -p build/$@43 $(DESTFOLDERS): 44 mkdir -p $@ 36 45 37 46 build/%.o: src/%.c -
Daodan/src/Daodan_BSL.c
r876 r877 821 821 } 822 822 823 extern void SLrFlatline_Initialize();824 825 823 void SLrDaodan_Initialize() 826 824 { … … 859 857 SLrScript_Command_Register_ReturnType("st", "Prints to console in color", "", sl_void, bsl_dprintcolored); 860 858 SLrScript_Command_Register_ReturnType("d_dprint", "Prints to console in color", "", sl_void, bsl_dprintcolored); 861 862 #ifdef FLATLINE863 SLrFlatline_Initialize();864 #endif865 859 } 866 860 -
Daodan/src/Daodan_Config.c
r843 r877 21 21 bool patch_cooldowntimer = true; 22 22 bool patch_daodandisplayenum = true; 23 bool patch_daodaninit = true;24 23 bool patch_directinput = true; 25 24 bool patch_disablecmdline = true; 25 bool patch_flatline = true; 26 26 bool patch_fonttexturecache = true; 27 27 bool patch_getcmdline = true; … … 120 120 else if (!_stricmp(name, "daodandisplayenum")) 121 121 patch_daodandisplayenum = !_stricmp(inifile_cleanstr(value), "true"); 122 else if (!_stricmp(name, "daodaninit"))123 patch_daodaninit = !_stricmp(inifile_cleanstr(value), "true");124 122 else if (!_stricmp(name, "directinput")) 125 123 patch_directinput = !_stricmp(inifile_cleanstr(value), "true"); 126 124 else if (!_stricmp(name, "disablecmdline")) 127 125 patch_disablecmdline = !_stricmp(inifile_cleanstr(value), "true"); 126 else if (!_stricmp(name, "flatline")) 127 patch_flatline = !_stricmp(inifile_cleanstr(value), "true"); 128 128 else if (!_stricmp(name, "fonttexturecache")) 129 129 patch_fonttexturecache = !_stricmp(inifile_cleanstr(value), "true"); … … 304 304 { 305 305 fputs("[Options]\n", fp); 306 fputs("[Patch]\n", fp); 307 fputs("[BSL]\n", fp); 308 fputs("[Language]\n", fp); 306 309 fclose(fp); 307 310 } -
Daodan/src/Daodan_Config.h
r843 r877 16 16 extern bool patch_cooldowntimer; 17 17 extern bool patch_daodandisplayenum; 18 extern bool patch_daodaninit;19 18 extern bool patch_directinput; 20 19 extern bool patch_disablecmdline; 20 extern bool patch_flatline; 21 21 extern bool patch_fonttexturecache; 22 22 extern bool patch_getcmdline; -
Daodan/src/flatline/Flatline.c
r876 r877 1 1 #include "Flatline.h" 2 #include " Oni_Character.h"3 #include " Oni_Gamestate.h"4 #include " Oni_Symbols.h"2 #include "../Oni_Character.h" 3 #include "../Oni_GameState.h" 4 #include "../Oni_Symbols.h" 5 5 #include "Flatline_Client.h" 6 6 #include "Flatline_Server.h" 7 7 #include "Flatline_Events.h" 8 #include " Daodan_Utility.h"9 #include < Windows.h>8 #include "../Daodan_Utility.h" 9 #include <windows.h> 10 10 //#include <sys/time.h> 11 11 #include <time.h> 12 12 #include <float.h> 13 13 14 #define isnan(x) ((x) != (x)) 15 14 16 uint32_t last1 = 0; uint32_t last2 = 0; 15 17 player_info Players[MAX_PLAYERS] = {{0}, {0}, {0}, {0}}; -
Daodan/src/flatline/Flatline.h
r876 r877 1 #pragma once2 1 #ifndef FLATLINE_H 3 2 #define FLATLINE_H … … 17 16 #include <winsock2.h> 18 17 #include "Flatline_Win32.h" 19 #else 20 #include <sys/ioctl.h> 21 #include <sys/types.h> 22 #include <sys/socket.h> 23 #include <unistd.h> 24 #include <stropts.h> 25 #include <arpa/inet.h> 26 #include <netinet/in.h> 27 28 #define NetPlatform_Initalize() /* */ 29 #define NetPlatform_Shutdown() /* */ 30 #define closesocket close 31 #define ioctlsocket ioctl 32 #endif 33 34 #include "Daodan.h" 35 #include "BFW_Utility.h" 36 #include "Daodan_Console.h" 37 #include "Oni_Character.h" 38 #include "Oni_Gamestate.h" 18 19 #include "../Daodan.h" 20 #include "../BFW_Utility.h" 21 #include "../Daodan_Console.h" 22 #include "../Oni_Character.h" 23 #include "../Oni_GameState.h" 39 24 #include "Flatline_Packet.h" 40 25 41 #include " Oni_Symbols.h"26 #include "../Oni_Symbols.h" 42 27 //#define breakpoint asm("int3") 43 28 … … 307 292 308 293 #define FLATLINE_PORT 27778 294 295 #endif -
Daodan/src/flatline/Flatline_BSL.c
r876 r877 1 1 #include <winsock2.h> 2 #include " BFW_ScriptLang.h"3 4 #include " Daodan_Patch.h"5 #include " Daodan_BSL.h"2 #include "../BFW_ScriptLang.h" 3 4 #include "../Daodan_Patch.h" 5 #include "../Daodan_BSL.h" 6 6 #include "Flatline_BSL.h" 7 7 #include "Flatline.h" … … 9 9 #include "Mariusnet_Public.h" 10 10 #include "Flatline_Client.h" 11 11 12 unsigned char server_started = 0; 12 13 unsigned char client_connected = 0; … … 16 17 char player_country[256] = {0}; 17 18 int update_rate = 5; 18 #include "Oni.h" 19 #include "Daodan_Cheater.h" 19 20 #include "../Oni.h" 21 #include "../Daodan_Cheater.h" 22 20 23 uint16_t ONICALL start_server(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret) 21 24 { -
Daodan/src/flatline/Flatline_BSL.h
r876 r877 1 1 #ifndef FLATLINE_BSL_H 2 2 #define FLATLINE_BSL_H 3 #include " Daodan.h"3 #include "../Daodan.h" 4 4 void SLrFlatline_Initialize(); 5 5 uint16_t ONICALL FLrSpawnHack(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret); -
Daodan/src/flatline/Flatline_Hooks.c
r876 r877 32 32 } 33 33 34 int FLrHook_DebugNameTextureInit(short width, short height, int type, int allocated, int flags, char* name, void** output)35 {36 //flags = (1 << 10);37 type = 1;38 //DDrPatch_Byte( 0x005EB83C + 3, 0xff );39 DDrPatch_Int32( 0x005EB83C, 0xFF000000 );40 return M3rTextureMap_New(width, height, type, allocated, flags, name, output);41 }42 43 short FLrHook_DebugNameShadeHack( Character* Char )44 {45 46 return TSrContext_SetShade(*(void**)0x005EB844, ONrCharacter_GetHealthShade( Char->Health, Char->MaxHealth ));47 //return TSrContext_SetShade(*(void**)0x005EB844, 0xFFFFFFFF);48 }49 34 /* 50 35 void FLrHook_Lasers( Character* PlayerChar ) -
Daodan/src/flatline/Flatline_Hooks.h
r876 r877 1 #include "Oni.h" 1 #ifndef FLATLINE_HOOKS_H 2 #define FLATLINE_HOOKS_H 3 4 #include "../Oni.h" 2 5 char * FLrHook_DoorOpen( DoorObject *Door, Character *Char); 3 6 short FLrHook_ConsoleActivate( void *inObject, Character *inCharacter ); 4 int FLrHook_DebugNameTextureInit(short width, short height, int type, int allocated, int flags, char* name, void** output);5 short FLrHook_DebugNameShadeHack( Character* Char );6 7 void FLrHook_Lasers( Character* PlayerChar ); 8 9 #endif -
Daodan/src/flatline/Flatline_Net.c
r876 r877 1 #include "Flatline_Net.h" 1 2 #include "Flatline.h" 2 3 #include "Flatline_Server.h" -
Daodan/src/flatline/Flatline_Net.h
r876 r877 1 1 #ifndef FLATLINE_NET_H 2 2 #define FLATLINE_NET_H 3 4 #include "stdint.h" 3 5 4 6 #define pad1_size (sizeof(int64_t) - sizeof(short)) -
Daodan/src/flatline/Flatline_PacketBuilder.c
r876 r877 1 1 #include "Flatline.h" 2 #include " Oni_Symbols.h"2 #include "../Oni_Symbols.h" 3 3 #include <assert.h> 4 4 -
Daodan/src/flatline/Flatline_Server.c
r876 r877 1 1 #include "Flatline.h" 2 2 #include "Flatline_Server.h" 3 #include < Windows.h>3 #include <windows.h> 4 4 //#include "PortForwardWrapper.h" 5 5 #include "Mariusnet_Public.h" -
Daodan/src/flatline/Flatline_Win32.h
r876 r877 1 #pragma once 1 #ifndef FLATLINE_WIN32_H 2 #define FLATLINE_WIN32_H 2 3 3 4 unsigned char NetPlatform_Initalize(); 4 5 unsigned char NetPlatform_Shutdown(); 6 7 #endif -
Daodan/src/flatline/Mariusnet.c
r876 r877 6 6 #include "Flatline_Client.h" 7 7 #include "Mariusnet_Defs.h" 8 #include " Daodan_Console.h"9 #include " Oni_Symbols.h"8 #include "../Daodan_Console.h" 9 #include "../Oni_Symbols.h" 10 10 #include <stdio.h> 11 11 -
Daodan/src/flatline/Mariusnet_Defs.h
r876 r877 1 #ifndef MARIUSNET_DEFS_H 2 #define MARIUSNET_DEFS_H 3 1 4 //to client 2 5 #include "Mariusnet_Public.h" … … 215 218 }; 216 219 } marius_packet; 220 221 #endif -
Daodan/src/patches/Patches.c
r876 r877 10 10 #include "../Daodan_Utility.h" 11 11 #include "../Daodan_Win32.h" 12 #ifdef FLATLINE 13 #include "../Flatline_BSL.h" 14 #include "../Flatline_Hooks.h" 15 #endif 12 #include "../flatline/Flatline_BSL.h" 13 #include "../flatline/Flatline_Hooks.h" 16 14 #include "../Oni.h" 17 15 … … 44 42 if (opt_usedaodanbsl) 45 43 SLrDaodan_Initialize(); 44 if (patch_flatline) 45 SLrFlatline_Initialize(); 46 46 } 47 47 … … 81 81 82 82 83 int FLrHook_DebugNameTextureInit(short width, short height, int type, int allocated, int flags, char* name, void** output)83 int DD_Patch_DebugNameTextureInit(short width, short height, int type, int allocated, int flags, char* name, void** output) 84 84 { 85 85 //flags = (1 << 10); … … 90 90 } 91 91 92 short FLrHook_DebugNameShadeHack( Character* Char )92 short DD_Patch_DebugNameShadeHack( Character* Char ) 93 93 { 94 94 return TSrContext_SetShade(*(void**)(OniExe + 0x001EB844), ONrCharacter_GetHealthShade( Char->Health, Char->MaxHealth )); … … 244 244 } 245 245 246 // Enable flatline multiplayer code 247 void DD_Patch_Flatline() 248 { 249 DDrPatch_NOOP((char*)(OniExe + 0x000E1957), 6 ); 250 DDrPatch_MakeCall((void*)(OniExe + 0x000E17F6), FLrHook_Lasers ); 251 252 253 //Flatline related stuff 254 DDrPatch_MakeCall((void*)(OniExe + 0x000FBCEA), DDrText_Hook); 255 256 DDrPatch_Int32((int*)(OniExe + 0x000B24D2), FLrSpawnHack); 257 258 DDrPatch_NOOP((char*)(OniExe + 0x000C26CB), 6); 259 260 DDrPatch_MakeCall((void*)(OniExe + 0x000C26CB), FLrHook_DoorOpen); 261 DDrPatch_MakeCall((void*)(OniExe + 0x000EE3CF), FLrHook_ConsoleActivate); 262 } 263 246 264 // Font texture cache doubled 247 265 void DD_Patch_FontTextureCache() … … 455 473 DDrPatch_Byte((char*)(OniExe + 0x0008C899), 0xCE ); 456 474 457 DDrPatch_MakeCall((void*)(OniExe + 0x0008C8A3), FLrHook_DebugNameShadeHack);475 DDrPatch_MakeCall((void*)(OniExe + 0x0008C8A3), DD_Patch_DebugNameShadeHack); 458 476 459 477 //Make the background black for additive blending 460 DDrPatch_MakeCall((void*)(OniExe + 0x0008C802), FLrHook_DebugNameTextureInit );478 DDrPatch_MakeCall((void*)(OniExe + 0x0008C802), DD_Patch_DebugNameTextureInit ); 461 479 */ 462 480 } … … 499 517 DD_Patch_DaodanDisplayEnum(); 500 518 501 if (patch_daodaninit)502 DD_Patch_DaodanInit();503 504 519 if (patch_directinput) 505 520 DD_Patch_DirectInput(); … … 560 575 561 576 577 DD_Patch_DaodanInit(); 578 562 579 DD_Patch_GammaSlider(); 563 580 … … 567 584 DD_Patch_ShowNames(); 568 585 569 #ifdef FLATLINE 570 DDrPatch_NOOP((char*)(OniExe + 0x000E1957), 6 ); 571 DDrPatch_MakeCall((void*)(OniExe + 0x000E17F6), FLrHook_Lasers ); 572 573 574 575 //Flatline related stuff 576 DDrPatch_MakeCall((void*)(OniExe + 0x000FBCEA), DDrText_Hook); 577 578 DDrPatch_Int32((int*)(OniExe + 0x000B24D2), FLrSpawnHack); 579 580 DDrPatch_NOOP((char*)(OniExe + 0x000C26CB), 6); 581 582 DDrPatch_MakeCall((void*)(OniExe + 0x000C26CB), FLrHook_DoorOpen); 583 DDrPatch_MakeCall((void*)(OniExe + 0x000EE3CF), FLrHook_ConsoleActivate); 584 #endif 586 if (patch_flatline) 587 DD_Patch_Flatline(); 585 588 586 589 return true;
Note:
See TracChangeset
for help on using the changeset viewer.