├── .gitignore ├── CHANGES-0.42.06.todo ├── CHANGES-0.43.03.todo ├── Makefile ├── QR_Encode.cpp ├── QR_Encode.h ├── README.md ├── Screens.md ├── build-windows.bat ├── building_classes.txt ├── buildings.hpp ├── civlist.hpp ├── commands.hpp ├── config.hpp ├── connect.hpp ├── corehacks.hpp ├── dfui ├── animaltrap1.png ├── animaltrap2.png ├── animaltrap3.png ├── archerytarget1.png ├── archerytarget2.png ├── ballista1.png ├── bed1.png ├── bed2.png ├── bed3.png ├── bed4.png ├── butchersshop1.png ├── cage1.png ├── cage2.png ├── cage3.png ├── cage4.png ├── catapult1.png ├── chair1.png ├── chair2.png ├── coffin1.png ├── coffin2.png ├── coffin3.png ├── dirtroad1.png ├── door1.png ├── door2.png ├── door3.png ├── embark-finder1.png ├── embark1.png ├── farmplot1.png ├── farmplot2.png ├── farmplot3.png ├── hive1.png ├── hive2.png ├── horaxle1.png ├── horaxle2.png ├── meeting_topics │ ├── 0.png │ ├── 1.png │ ├── 2-1.png │ ├── 2-2.png │ ├── 3-1.png │ ├── 3-barony-novstype.png │ ├── 3-barony.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── 7.png │ └── 8.png ├── nestbox1.png ├── new-slab1.png ├── pplate1.png ├── pplate2.png ├── rollers1.png ├── rollers2.png ├── room1.png ├── room2.png ├── table1.png ├── table2.png ├── table3.png ├── unit_effect_colours │ ├── Screen Shot 2015-03-07 at 6.50.15 pm.png │ ├── Screen Shot 2015-03-07 at 6.51.36 pm.png │ ├── Screen Shot 2015-03-07 at 6.52.18 pm.png │ ├── Screen Shot 2015-03-07 at 6.54.27 pm.png │ ├── Screen Shot 2015-03-07 at 7.31.24 pm.png │ ├── Screen Shot 2015-03-07 at 7.31.51 pm.png │ ├── Screen Shot 2015-03-07 at 7.36.15 pm.png │ ├── Screen Shot 2015-03-07 at 7.36.48 pm.png │ ├── Screen Shot 2015-03-07 at 7.37.43 pm.png │ ├── Screen Shot 2015-03-07 at 9.16.24 pm.png │ ├── Screen Shot 2015-03-07 at 9.17.18 pm.png │ ├── Screen Shot 2015-03-07 at 9.18.13 pm.png │ ├── Screen Shot 2015-03-07 at 9.18.29 pm.png │ ├── Screen Shot 2015-03-07 at 9.20.04 pm.png │ ├── Screen Shot 2015-03-07 at 9.20.47 pm.png │ ├── Screen Shot 2015-03-08 at 12.20.50 am.png │ ├── Screen Shot 2015-03-08 at 12.21.18 am.png │ └── Screen Shot 2015-03-08 at 12.22.17 am.png ├── veraxle1.png ├── veraxle2.png ├── waterwheel1.png ├── weaponrack1.png ├── weaponrack2.png ├── weaponrack3.png ├── windmill1.png ├── workshop-mood1.png ├── worldparams1.png └── zones │ └── hospital-max.png ├── dwarfmode.hpp ├── embark.hpp ├── enet ├── ChangeLog ├── Doxyfile ├── LICENSE ├── Makefile.am ├── Makefile.in ├── README ├── aclocal.m4 ├── callbacks.c ├── compile ├── compress.c ├── config.guess ├── config.sub ├── configure ├── configure.ac ├── depcomp ├── docs │ ├── FAQ.dox │ ├── design.dox │ ├── html │ │ ├── FAQ.html │ │ ├── Features.html │ │ ├── IRCChannel.html │ │ ├── Installation.html │ │ ├── License.html │ │ ├── MailingList.html │ │ ├── SourceDistro.html │ │ ├── Tutorial.html │ │ ├── annotated.html │ │ ├── bc_s.png │ │ ├── bdwn.png │ │ ├── callbacks_8c.html │ │ ├── callbacks_8h.html │ │ ├── callbacks_8h_source.html │ │ ├── classes.html │ │ ├── closed.png │ │ ├── compress_8c.html │ │ ├── dir_d44c64559bbebec7f509842c48db8b23.html │ │ ├── dir_fd6c3a2b8754f03ff2a62b53108cf6e2.html │ │ ├── doxygen.css │ │ ├── doxygen.png │ │ ├── dynsections.js │ │ ├── enet_8h.html │ │ ├── enet_8h_source.html │ │ ├── files.html │ │ ├── ftv2blank.png │ │ ├── ftv2cl.png │ │ ├── ftv2doc.png │ │ ├── ftv2folderclosed.png │ │ ├── ftv2folderopen.png │ │ ├── ftv2lastnode.png │ │ ├── ftv2link.png │ │ ├── ftv2mlastnode.png │ │ ├── ftv2mnode.png │ │ ├── ftv2mo.png │ │ ├── ftv2node.png │ │ ├── ftv2ns.png │ │ ├── ftv2plastnode.png │ │ ├── ftv2pnode.png │ │ ├── ftv2splitbar.png │ │ ├── ftv2vertline.png │ │ ├── functions.html │ │ ├── functions_func.html │ │ ├── functions_vars.html │ │ ├── globals.html │ │ ├── globals_defs.html │ │ ├── globals_enum.html │ │ ├── globals_eval.html │ │ ├── globals_func.html │ │ ├── globals_type.html │ │ ├── group__Address.html │ │ ├── group__Packet.html │ │ ├── group__callbacks.html │ │ ├── group__global.html │ │ ├── group__host.html │ │ ├── group__list.html │ │ ├── group__peer.html │ │ ├── group__private.html │ │ ├── group__socket.html │ │ ├── host_8c.html │ │ ├── index.html │ │ ├── list_8c.html │ │ ├── list_8h.html │ │ ├── list_8h_source.html │ │ ├── modules.html │ │ ├── nav_f.png │ │ ├── nav_g.png │ │ ├── nav_h.png │ │ ├── open.png │ │ ├── packet_8c.html │ │ ├── pages.html │ │ ├── peer_8c.html │ │ ├── protocol_8c.html │ │ ├── protocol_8h.html │ │ ├── protocol_8h_source.html │ │ ├── structENetBuffer.html │ │ ├── struct__ENetAcknowledgement.html │ │ ├── struct__ENetAddress.html │ │ ├── struct__ENetCallbacks.html │ │ ├── struct__ENetChannel.html │ │ ├── struct__ENetCompressor.html │ │ ├── struct__ENetEvent.html │ │ ├── struct__ENetHost.html │ │ ├── struct__ENetIncomingCommand.html │ │ ├── struct__ENetList.html │ │ ├── struct__ENetListNode.html │ │ ├── struct__ENetOutgoingCommand.html │ │ ├── struct__ENetPacket.html │ │ ├── struct__ENetPeer.html │ │ ├── struct__ENetProtocolAcknowledge.html │ │ ├── struct__ENetProtocolBandwidthLimit.html │ │ ├── struct__ENetProtocolCommandHeader.html │ │ ├── struct__ENetProtocolConnect.html │ │ ├── struct__ENetProtocolDisconnect.html │ │ ├── struct__ENetProtocolHeader.html │ │ ├── struct__ENetProtocolPing.html │ │ ├── struct__ENetProtocolSendFragment.html │ │ ├── struct__ENetProtocolSendReliable.html │ │ ├── struct__ENetProtocolSendUnreliable.html │ │ ├── struct__ENetProtocolSendUnsequenced.html │ │ ├── struct__ENetProtocolThrottleConfigure.html │ │ ├── struct__ENetProtocolVerifyConnect.html │ │ ├── sync_off.png │ │ ├── sync_on.png │ │ ├── tab_a.png │ │ ├── tab_b.png │ │ ├── tab_h.png │ │ ├── tab_s.png │ │ ├── tabs.css │ │ ├── time_8h.html │ │ ├── time_8h_source.html │ │ ├── types_8h.html │ │ ├── types_8h_source.html │ │ ├── union__ENetProtocol.html │ │ ├── unix_8c.html │ │ ├── unix_8h.html │ │ ├── unix_8h_source.html │ │ ├── utility_8h.html │ │ ├── utility_8h_source.html │ │ ├── win32_8c.html │ │ ├── win32_8h.html │ │ └── win32_8h_source.html │ ├── install.dox │ ├── license.dox │ ├── mainpage.dox │ └── tutorial.dox ├── enet.dsp ├── enet.lib ├── enet.xcodeproj │ └── project.pbxproj ├── enet64.lib ├── enet_dll.cbp ├── host.c ├── include │ └── enet │ │ ├── callbacks.h │ │ ├── enet.h │ │ ├── list.h │ │ ├── protocol.h │ │ ├── time.h │ │ ├── types.h │ │ ├── unix.h │ │ ├── utility.h │ │ └── win32.h ├── install-sh ├── libenet.pc ├── libenet.pc.in ├── list.c ├── ltmain.sh ├── m4 │ ├── .keep │ ├── libtool.m4 │ ├── ltoptions.m4 │ ├── ltsugar.m4 │ ├── ltversion.m4 │ └── lt~obsolete.m4 ├── missing ├── packet.c ├── peer.c ├── protocol.c ├── unix.c └── win32.c ├── firewall-win.cpp ├── item_classes.txt ├── itemcache.hpp ├── items.hpp ├── lua ├── JSON.lua ├── MessagePack.lua ├── MessagePack53.lua ├── alerts.lua ├── ammunition.lua ├── animals.lua ├── build.lua ├── buildings.lua ├── burrows.lua ├── compat.lua ├── compat_47.lua ├── deflatelua.lua ├── depot.lua ├── dfaas.lua ├── embark.lua ├── equipment.lua ├── hauling.lua ├── init.lua ├── items.lua ├── jobdetails.lua ├── jobs.lua ├── justice.lua ├── kitchen.lua ├── labors.lua ├── locations.lua ├── manager.lua ├── meeting.lua ├── military.lua ├── nobles.lua ├── orders.lua ├── petitions.lua ├── raws.lua ├── reports.lua ├── savegame.lua ├── schedule.lua ├── screens.lua ├── setup.lua ├── squads.lua ├── status.lua ├── stockpile.lua ├── stocks.lua ├── stone.lua ├── underscore.lua ├── uniforms.lua ├── units.lua ├── utf8 │ ├── utf8.lua │ └── utf8data.lua ├── utils.lua ├── version.lua ├── waypoints.lua ├── worldgen.lua ├── worldinfo.lua ├── worldmap.lua └── zones.lua ├── nopoll-win ├── include │ ├── nopoll.h │ ├── nopoll_config.h │ ├── nopoll_conn.h │ ├── nopoll_ctx.h │ ├── nopoll_decl.h │ ├── nopoll_handlers.h │ ├── nopoll_io.h │ ├── nopoll_listener.h │ ├── nopoll_log.h │ ├── nopoll_loop.h │ ├── nopoll_msg.h │ ├── nopoll_private.h │ └── nopoll_win32.h ├── libeay32.dll ├── libnopoll.dll ├── libnopoll.lib └── ssleay32.dll ├── nopoll ├── AUTHORS ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile ├── Makefile.am ├── Makefile.in ├── Makefile.win ├── NEWS ├── README ├── TODO ├── VERSION ├── aclocal.m4 ├── config.guess ├── config.h ├── config.h.in ├── config.log ├── config.status ├── config.sub ├── configure ├── configure.ac ├── depcomp ├── doc │ ├── Makefile │ ├── Makefile.am │ ├── Makefile.in │ ├── aspl-logo-header.png │ ├── body_back.gif │ ├── main-page-logo.png │ ├── nopoll-doc-footer.html │ ├── nopoll-doc-header.html │ ├── nopoll.css │ ├── nopoll.doxygen │ └── nopoll.doxygen.in ├── install-sh ├── libtool ├── ltmain.sh ├── missing ├── nopoll.pc ├── nopoll.pc.in ├── src │ ├── Makefile │ ├── Makefile.am │ ├── Makefile.in │ ├── Makefile.win │ ├── libnopoll.def │ ├── nopoll.c │ ├── nopoll.h │ ├── nopoll_config.h │ ├── nopoll_conn.c │ ├── nopoll_conn.h │ ├── nopoll_ctx.c │ ├── nopoll_ctx.h │ ├── nopoll_decl.c │ ├── nopoll_decl.h │ ├── nopoll_handlers.h │ ├── nopoll_io.c │ ├── nopoll_io.h │ ├── nopoll_listener.c │ ├── nopoll_listener.h │ ├── nopoll_log.c │ ├── nopoll_log.h │ ├── nopoll_loop.c │ ├── nopoll_loop.h │ ├── nopoll_msg.c │ ├── nopoll_msg.h │ ├── nopoll_private.h │ ├── nopoll_win32.c │ └── nopoll_win32.h ├── stamp-h1 └── test │ ├── Makefile │ ├── Makefile.am │ ├── Makefile.in │ ├── Makefile.win │ ├── nopoll-regression-client.c │ ├── nopoll-regression-listener.c │ ├── test-certificate.crt │ └── test-private.key ├── patches.hpp ├── plugin.hpp ├── remote.cpp ├── remote64.vcxproj ├── sha256.cpp ├── sha256.h └── units.hpp /.gitignore: -------------------------------------------------------------------------------- 1 | enet/.deps 2 | enet/.libs 3 | enet/*.o 4 | enet/*.lo 5 | enet/*.la 6 | enet/config.log 7 | enet/config.status 8 | enet/libtool 9 | enet/Makefile 10 | x64 11 | Release 12 | remote64.vcxproj.user 13 | .vs 14 | dist/0.* 15 | -------------------------------------------------------------------------------- /CHANGES-0.42.06.todo: -------------------------------------------------------------------------------- 1 | New stuff 2 | - Monster slayers can petition your fortress to go down and fight monsters once you discover the underground 3 | - Can specify group's symbol at embark -------------------------------------------------------------------------------- /CHANGES-0.43.03.todo: -------------------------------------------------------------------------------- 1 | New stuff 2 | - Can put start conditions on work orders (by amount of resources or dependence on other work orders) 3 | - Can create work order from profile which is tied to specific workshop 4 | - Can set maximum number of general work orders per shop or disallow them by profession or altogether (note: this won't work for active old-save jobs) 5 | - Repeatable work orders, ability to set restart frequencies 6 | 7 | Other bug fixes/tweaks 8 | - Allowed some site-wide occupations for dwarves 9 | - Made paper slurries stockpile-able (won't work without updated raws) -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | DFHACKVER ?= 0.47.05-r8 2 | 3 | DFVERNUM = `echo $(DFHACKVER) | sed -e s/-.*// -e s/\\\\.//g` 4 | 5 | DF ?= /Users/vpronkin/Downloads/df_47_05_osx 6 | DH ?= /Users/vpronkin/Downloads/dfhack 7 | 8 | BITS ?= 64 9 | GCCVER ?= 7 10 | 11 | SRC = remote.cpp sha256.cpp QR_Encode.cpp 12 | DEP = dwarfmode.hpp embark.hpp commands.hpp plugin.hpp patches.hpp itemcache.hpp config.hpp corehacks.hpp sha256.h connect.hpp units.hpp items.hpp buildings.hpp civlist.hpp Makefile 13 | 14 | ifeq ($(shell uname -s), Darwin) 15 | ifneq (,$(findstring 0.34,$(DFHACKVER))) 16 | EXT = so 17 | else 18 | EXT = dylib 19 | endif 20 | else 21 | EXT = so 22 | endif 23 | OUT = dist/$(DFHACKVER)/remote.plug.$(EXT) 24 | 25 | INC = -I"$(DH)/library/include" -I"$(DH)/library/proto" -I"$(DH)/depends/protobuf" -I"$(DH)/depends/lua/include" -I"$(DH)/depends/tthread" -Ienet/include 26 | LIB = -L"$(DH)/build/library" -ldfhack -ldfhack-version -L"$(DH)/build/depends/tthread" -ldfhack-tinythread ./enet/.libs/libenet.a 27 | 28 | CFLAGS = $(INC) -m$(BITS) -DLINUX_BUILD -O3 -DUSE_FILE32API -D_GLIBCXX_USE_CXX11_ABI=0 29 | LDFLAGS = $(LIB) -shared 30 | 31 | ifeq ($(shell uname -s), Darwin) 32 | export MACOSX_DEPLOYMENT_TARGET=10.6 33 | CXX = g++-$(GCCVER) 34 | CFLAGS += -std=gnu++0x 35 | CFLAGS += -Wno-tautological-compare 36 | LDFLAGS += -framework Security -undefined dynamic_lookup #-mmacosx-version-min=10.6 37 | else 38 | CXX = g++-$(GCCVER) 39 | CFLAGS += -std=c++0x -fPIC 40 | LDFLAGS += -fuse-ld=gold --no-gnu-unique 41 | endif 42 | 43 | 44 | all: $(OUT) 45 | 46 | $(OUT): $(SRC) $(DEP) 47 | -@mkdir -p `dirname $(OUT)` 48 | $(CXX) $(SRC) -o $(OUT) -DDF_$(DFVERNUM) $(CFLAGS) $(LDFLAGS) 49 | 50 | inst: $(OUT) 51 | cp $(OUT) "$(DF)/hack/plugins/" 52 | 53 | install: inst 54 | 55 | clean: 56 | -rm $(OUT) 57 | -------------------------------------------------------------------------------- /QR_Encode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * QR_Encode.h 3 | * 4 | * Created on: Jan 18, 2012 5 | * Author: swex 6 | */ 7 | 8 | #ifndef _QR_ENCODE_H_ 9 | #define _QR_ENCODE_H_ 10 | 11 | /* Error correction level */ 12 | #define QR_LEVEL_L (0) 13 | #define QR_LEVEL_M (1) 14 | #define QR_LEVEL_Q (2) 15 | #define QR_LEVEL_H (3) 16 | 17 | /* Data Mode */ 18 | #define QR_MODE_NUMERAL (0) 19 | #define QR_MODE_ALPHABET (1) 20 | #define QR_MODE_8BIT (2) 21 | #define QR_MODE_KANJI (3) 22 | 23 | /* Group version (model number) */ 24 | #define QR_VERSION_S (0) /* 1 ~ 9 */ 25 | #define QR_VERSION_M (1) /* 10 ~ 26 */ 26 | #define QR_VERSION_L (2) /* 27 ~ 40 */ 27 | 28 | /* Sizes */ 29 | #define MAX_ALLCODEWORD (3706) /* The maximum total number of code words */ 30 | #define MAX_DATACODEWORD (2956) /* Maximum data word code (version 40-L) */ 31 | #define MAX_CODEBLOCK (153) /* (Including RS code word) the maximum number 32 | of block data code word */ 33 | #define MAX_MODULESIZE (177) /* Maximum number of modules in a side */ 34 | #define MAX_BITDATA (3917) /* finfile data */ 35 | 36 | int EncodeData(int, int, const char *, int, unsigned char *); 37 | /* See README.md for usage. */ 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dwarf Fortress Remote Server 2 | 3 | To install, copy the plugin file for your operating system and DFHack version to `hack/plugins` folder inside your DF folder, and `remote` folder to `hack/lua` folder. 4 | 5 | See http://mifki.com/df for more info and iOS client app. 6 | 7 | 8 | ## License 9 | 10 | Copyright (c) 2016 Vitaly Pronkin 11 | 12 | This software is provided 'as-is', without any express or implied 13 | warranty. In no event will the authors be held liable for any damages 14 | arising from the use of this software. 15 | 16 | Permission is granted to anyone to use this software for any purpose, 17 | including commercial applications, and to alter it and redistribute it 18 | freely, subject to the following restrictions: 19 | 20 | 1. The origin of this software must not be misrepresented; you must not 21 | claim that you wrote the original software. If you use this software 22 | in a product, an acknowledgement in the product documentation would be 23 | appreciated but is not required. 24 | 2. Altered source versions must be plainly marked as such, and must not be 25 | misrepresented as being the original software. 26 | 3. This notice may not be removed or altered from any source distribution. 27 | -------------------------------------------------------------------------------- /build-windows.bat: -------------------------------------------------------------------------------- 1 | call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 2 | 3 | set DFHACKDIR="C:\Users\vit\Desktop\buildagent\workspace\root\dfhack\0.43.05-r3" 4 | set DFHACKVER=0.43.05-r3 5 | set DFVERNUM=04305 6 | 7 | 8 | msbuild /p:Platform=x64 /p:Configuration=Release /p:dfhack=%DFHACKDIR% /p:dfhackver=%DFHACKVER% /p:twbt_ver=%TWBT_VER% /p:dfvernum=%DFVERNUM% remote64.vcxproj 9 | 10 | copy dist\0.43.05-r3\remote.plug.dll z:\df_43_05_win\hack\plugins -------------------------------------------------------------------------------- /building_classes.txt: -------------------------------------------------------------------------------- 1 | +building_animaltrapst.h 2 | +building_archerytargetst.h 3 | +building_armorstandst.h 4 | +building_axle_horizontalst.h 5 | +building_axle_verticalst.h 6 | +building_bars_floorst.h 7 | +building_bars_verticalst.h 8 | +building_bedst.h 9 | +building_bookcasest.h 10 | +building_boxst.h 11 | building_bridgest.h 12 | +building_cabinetst.h 13 | +building_cagest.h 14 | +building_chainst.h 15 | +building_chairst.h 16 | -building_civzonest.h 17 | +building_coffinst.h 18 | building_constructionst.h 19 | +building_doorst.h 20 | -building_farmplotst.h 21 | building_floodgatest.h 22 | +building_furnacest.h 23 | +building_gear_assemblyst.h 24 | building_grate_floorst.h 25 | building_grate_wallst.h 26 | +building_hatchst.h 27 | +building_hivest.h 28 | +building_instrumentst.h 29 | +building_nest_boxst.h 30 | building_nestst.h 31 | -building_road_dirtst.h 32 | -building_road_pavedst.h 33 | +building_rollersst.h 34 | +building_screw_pumpst.h 35 | building_shopst.h 36 | +building_siegeenginest.h 37 | +building_slabst.h 38 | +building_statuest.h 39 | -building_stockpilest.h 40 | +building_supportst.h 41 | +building_tablest.h 42 | +building_traction_benchst.h 43 | +building_tradedepotst.h 44 | +building_trapst.h 45 | building_wagonst.h 46 | building_water_wheelst.h 47 | +building_weaponrackst.h 48 | +building_weaponst.h 49 | +building_wellst.h 50 | building_windmillst.h 51 | building_window_gemst.h 52 | building_window_glassst.h 53 | building_windowst.h 54 | +building_workshopst.h -------------------------------------------------------------------------------- /civlist.hpp: -------------------------------------------------------------------------------- 1 | void render_remote_world_map() 2 | { 3 | // render_mutex.lock(); 4 | // rendering_remote_map = true; 5 | 6 | // uint8_t menu_width, area_map_width; 7 | // Gui::getMenuWidth(menu_width, area_map_width); 8 | 9 | // gmenu_w = get_menu_width(); 10 | 11 | int w = world->world_data->world_width, h = world->world_data->world_height; 12 | 13 | int tdimx = gps->dimx; 14 | int tdimy = gps->dimy; 15 | 16 | uint8_t *sctop = gps->screen; 17 | 18 | gps->screen = world_map; 19 | gps->screen_limit = gscreen + w * h * 4; 20 | 21 | init->display.grid_x = w; 22 | init->display.grid_y = h; 23 | gps->dimx = w; 24 | gps->dimy = h; 25 | gps->clipx[1] = w; 26 | gps->clipy[1] = h; 27 | 28 | // waiting_render = true; 29 | 30 | // gwindow_x = *df::global::window_x = wx; 31 | // gwindow_y = *df::global::window_y = wy; 32 | // gwindow_z = *df::global::window_z = std::max(0, std::min(*df::global::window_z, world->map.z_count-1)); 33 | 34 | // memset(gscreen_under, 0, curwidth*curheight*sizeof(uint32_t)); 35 | // screen_under_ptr = gscreen_under; 36 | // screen_ptr = gscreen; 37 | // mwindow_x = gwindow_x; 38 | 39 | // if (maxlevels > 1 && *df::global::window_z > 0) 40 | // patch_rendering(false); 41 | 42 | render_world_map(world->world_data, 0, 0, 0, 0, w, h, 0, 0, 0, 0, 0, 0); 43 | 44 | // waiting_render = false; 45 | 46 | init->display.grid_x = gps->dimx = tdimx; 47 | init->display.grid_y = gps->dimy = tdimy; 48 | gps->clipx[1] = gps->dimx - 1; 49 | gps->clipy[1] = gps->dimy - 1; 50 | 51 | gps->screen = enabler->renderer->screen = sctop; 52 | gps->screen_limit = gps->screen + gps->dimx * gps->dimy * 4; 53 | 54 | // rendering_remote_map = false; 55 | // render_mutex.unlock(); 56 | } 57 | 58 | 59 | struct civlist_hook : public df::viewscreen_civlistst 60 | { 61 | typedef df::viewscreen_civlistst interpose_base; 62 | 63 | DEFINE_VMETHOD_INTERPOSE(void, render, ()) 64 | { 65 | INTERPOSE_NEXT(render)(); 66 | 67 | render_remote_world_map(); 68 | } 69 | }; 70 | 71 | IMPLEMENT_VMETHOD_INTERPOSE_PRIO(civlist_hook, render, -300); 72 | -------------------------------------------------------------------------------- /config.hpp: -------------------------------------------------------------------------------- 1 | static bool parse_int(std::string &str, int &ret, int base=10) 2 | { 3 | char *e; 4 | ret = strtol(str.c_str(), &e, base); 5 | return (*e == 0); 6 | } 7 | 8 | static bool parse_float(std::string &str, float &ret) 9 | { 10 | char *e; 11 | ret = strtod(str.c_str(), &e); 12 | return (*e == 0); 13 | } 14 | 15 | template 16 | static bool parse_enum_or_int(std::string &str, int &ret, int def=-1) 17 | { 18 | T val; 19 | 20 | if (str.length()) 21 | { 22 | if (!parse_int(str, ret)) 23 | { 24 | if (find_enum_item(&val, str)) 25 | ret = val; 26 | else 27 | return false; 28 | } 29 | } 30 | else 31 | ret = def; 32 | 33 | return true; 34 | } 35 | 36 | static vector split(const char *str, char c = ' ') 37 | { 38 | vector result; 39 | 40 | do 41 | { 42 | const char *begin = str; 43 | 44 | while(*str != c && *str) 45 | str++; 46 | 47 | result.push_back(string(begin, str)); 48 | } while (0 != *str++); 49 | 50 | return result; 51 | } 52 | 53 | static bool load_config() 54 | { 55 | bool enabled = false; 56 | 57 | std::ifstream fseed("data/init/remote.txt"); 58 | if(!fseed.is_open()) 59 | return false; 60 | 61 | char *tmp = getenv("DFREMOTE_PWD"); 62 | if (tmp) 63 | pwd_hash = hash_password(std::string(tmp)); 64 | else 65 | { 66 | tmp = getenv("DFREMOTE_PWD_HASH"); 67 | pwd_hash = tmp ? tmp : ""; 68 | } 69 | 70 | string str; 71 | while(std::getline(fseed,str)) 72 | { 73 | size_t b = str.find("["); 74 | size_t e = str.rfind("]"); 75 | 76 | if (b == string::npos || e == string::npos || str.find_first_not_of(" ") < b) 77 | continue; 78 | 79 | str = str.substr(b+1, e-1); 80 | vector tokens = split(str.c_str(), ':'); 81 | 82 | if (tokens[0] == "ENABLED" && tokens.size() == 2) 83 | { 84 | int val; 85 | if (parse_int(tokens[1], val)) 86 | enabled = val; 87 | 88 | continue; 89 | } 90 | 91 | if (tokens[0] == "PORT" && tokens.size() == 2) 92 | { 93 | int val; 94 | if (parse_int(tokens[1], val)) 95 | enet_port = val; 96 | 97 | continue; 98 | } 99 | 100 | if (tokens[0] == "PUBLISH_NAME" && tokens.size() == 2) 101 | { 102 | publish_name = tokens[1]; 103 | continue; 104 | } 105 | 106 | if (tokens[0] == "PWD" && tokens.size() == 2) 107 | { 108 | pwd_hash = tokens[1]; 109 | continue; 110 | } 111 | 112 | if (tokens[0] == "ADVFLAGS" && tokens.size() == 2) 113 | { 114 | int val; 115 | if (parse_int(tokens[1], val)) 116 | advflags = val; 117 | 118 | continue; 119 | } 120 | } 121 | 122 | return enabled; 123 | } 124 | 125 | void save_config() 126 | { 127 | std::ofstream ofs; 128 | ofs.open("data/init/remote.txt", std::ofstream::out|std::ofstream::trunc); 129 | 130 | if(!ofs.is_open()) 131 | return; 132 | 133 | ofs << "[ENABLED:" << (int)remote_on << "]" << std::endl; 134 | ofs << "[PORT:" << enet_port << "]" << std::endl; 135 | ofs << "[PUBLISH_NAME:" << publish_name << "]" << std::endl; 136 | ofs << "[PWD:" << pwd_hash << "]" << std::endl; 137 | 138 | if (advflags) 139 | ofs << "[ADVFLAGS:" << advflags << "]" << std::endl; 140 | } -------------------------------------------------------------------------------- /dfui/animaltrap1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/animaltrap1.png -------------------------------------------------------------------------------- /dfui/animaltrap2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/animaltrap2.png -------------------------------------------------------------------------------- /dfui/animaltrap3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/animaltrap3.png -------------------------------------------------------------------------------- /dfui/archerytarget1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/archerytarget1.png -------------------------------------------------------------------------------- /dfui/archerytarget2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/archerytarget2.png -------------------------------------------------------------------------------- /dfui/ballista1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/ballista1.png -------------------------------------------------------------------------------- /dfui/bed1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/bed1.png -------------------------------------------------------------------------------- /dfui/bed2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/bed2.png -------------------------------------------------------------------------------- /dfui/bed3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/bed3.png -------------------------------------------------------------------------------- /dfui/bed4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/bed4.png -------------------------------------------------------------------------------- /dfui/butchersshop1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/butchersshop1.png -------------------------------------------------------------------------------- /dfui/cage1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/cage1.png -------------------------------------------------------------------------------- /dfui/cage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/cage2.png -------------------------------------------------------------------------------- /dfui/cage3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/cage3.png -------------------------------------------------------------------------------- /dfui/cage4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/cage4.png -------------------------------------------------------------------------------- /dfui/catapult1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/catapult1.png -------------------------------------------------------------------------------- /dfui/chair1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/chair1.png -------------------------------------------------------------------------------- /dfui/chair2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/chair2.png -------------------------------------------------------------------------------- /dfui/coffin1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/coffin1.png -------------------------------------------------------------------------------- /dfui/coffin2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/coffin2.png -------------------------------------------------------------------------------- /dfui/coffin3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/coffin3.png -------------------------------------------------------------------------------- /dfui/dirtroad1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/dirtroad1.png -------------------------------------------------------------------------------- /dfui/door1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/door1.png -------------------------------------------------------------------------------- /dfui/door2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/door2.png -------------------------------------------------------------------------------- /dfui/door3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/door3.png -------------------------------------------------------------------------------- /dfui/embark-finder1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/embark-finder1.png -------------------------------------------------------------------------------- /dfui/embark1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/embark1.png -------------------------------------------------------------------------------- /dfui/farmplot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/farmplot1.png -------------------------------------------------------------------------------- /dfui/farmplot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/farmplot2.png -------------------------------------------------------------------------------- /dfui/farmplot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/farmplot3.png -------------------------------------------------------------------------------- /dfui/hive1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/hive1.png -------------------------------------------------------------------------------- /dfui/hive2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/hive2.png -------------------------------------------------------------------------------- /dfui/horaxle1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/horaxle1.png -------------------------------------------------------------------------------- /dfui/horaxle2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/horaxle2.png -------------------------------------------------------------------------------- /dfui/meeting_topics/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/meeting_topics/0.png -------------------------------------------------------------------------------- /dfui/meeting_topics/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/meeting_topics/1.png -------------------------------------------------------------------------------- /dfui/meeting_topics/2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/meeting_topics/2-1.png -------------------------------------------------------------------------------- /dfui/meeting_topics/2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/meeting_topics/2-2.png -------------------------------------------------------------------------------- /dfui/meeting_topics/3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/meeting_topics/3-1.png -------------------------------------------------------------------------------- /dfui/meeting_topics/3-barony-novstype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/meeting_topics/3-barony-novstype.png -------------------------------------------------------------------------------- /dfui/meeting_topics/3-barony.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/meeting_topics/3-barony.png -------------------------------------------------------------------------------- /dfui/meeting_topics/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/meeting_topics/4.png -------------------------------------------------------------------------------- /dfui/meeting_topics/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/meeting_topics/5.png -------------------------------------------------------------------------------- /dfui/meeting_topics/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/meeting_topics/6.png -------------------------------------------------------------------------------- /dfui/meeting_topics/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/meeting_topics/7.png -------------------------------------------------------------------------------- /dfui/meeting_topics/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/meeting_topics/8.png -------------------------------------------------------------------------------- /dfui/nestbox1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/nestbox1.png -------------------------------------------------------------------------------- /dfui/new-slab1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/new-slab1.png -------------------------------------------------------------------------------- /dfui/pplate1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/pplate1.png -------------------------------------------------------------------------------- /dfui/pplate2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/pplate2.png -------------------------------------------------------------------------------- /dfui/rollers1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/rollers1.png -------------------------------------------------------------------------------- /dfui/rollers2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/rollers2.png -------------------------------------------------------------------------------- /dfui/room1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/room1.png -------------------------------------------------------------------------------- /dfui/room2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/room2.png -------------------------------------------------------------------------------- /dfui/table1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/table1.png -------------------------------------------------------------------------------- /dfui/table2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/table2.png -------------------------------------------------------------------------------- /dfui/table3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/table3.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 6.50.15 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 6.50.15 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 6.51.36 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 6.51.36 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 6.52.18 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 6.52.18 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 6.54.27 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 6.54.27 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 7.31.24 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 7.31.24 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 7.31.51 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 7.31.51 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 7.36.15 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 7.36.15 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 7.36.48 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 7.36.48 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 7.37.43 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 7.37.43 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 9.16.24 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 9.16.24 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 9.17.18 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 9.17.18 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 9.18.13 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 9.18.13 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 9.18.29 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 9.18.29 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 9.20.04 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 9.20.04 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-07 at 9.20.47 pm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-07 at 9.20.47 pm.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-08 at 12.20.50 am.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-08 at 12.20.50 am.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-08 at 12.21.18 am.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-08 at 12.21.18 am.png -------------------------------------------------------------------------------- /dfui/unit_effect_colours/Screen Shot 2015-03-08 at 12.22.17 am.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/unit_effect_colours/Screen Shot 2015-03-08 at 12.22.17 am.png -------------------------------------------------------------------------------- /dfui/veraxle1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/veraxle1.png -------------------------------------------------------------------------------- /dfui/veraxle2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/veraxle2.png -------------------------------------------------------------------------------- /dfui/waterwheel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/waterwheel1.png -------------------------------------------------------------------------------- /dfui/weaponrack1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/weaponrack1.png -------------------------------------------------------------------------------- /dfui/weaponrack2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/weaponrack2.png -------------------------------------------------------------------------------- /dfui/weaponrack3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/weaponrack3.png -------------------------------------------------------------------------------- /dfui/windmill1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/windmill1.png -------------------------------------------------------------------------------- /dfui/workshop-mood1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/workshop-mood1.png -------------------------------------------------------------------------------- /dfui/worldparams1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/worldparams1.png -------------------------------------------------------------------------------- /dfui/zones/hospital-max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/dfui/zones/hospital-max.png -------------------------------------------------------------------------------- /embark.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct embark_hook : public df::viewscreen_choose_start_sitest 4 | { 5 | typedef df::viewscreen_choose_start_sitest interpose_base; 6 | 7 | DEFINE_VMETHOD_INTERPOSE(void, render, ()) 8 | { 9 | // The game crashes when moving selected embark location without this 10 | FastCoreSuspender suspend(2); 11 | INTERPOSE_NEXT(render)(); 12 | } 13 | }; 14 | 15 | IMPLEMENT_VMETHOD_INTERPOSE_PRIO(embark_hook, render, -300); 16 | -------------------------------------------------------------------------------- /enet/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2014 Lee Salzman 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /enet/Makefile.am: -------------------------------------------------------------------------------- 1 | pkgconfigdir = $(libdir)/pkgconfig 2 | nodist_pkgconfig_DATA = libenet.pc 3 | 4 | enetincludedir=$(includedir)/enet 5 | enetinclude_HEADERS = \ 6 | include/enet/callbacks.h \ 7 | include/enet/enet.h \ 8 | include/enet/list.h \ 9 | include/enet/protocol.h \ 10 | include/enet/time.h \ 11 | include/enet/types.h \ 12 | include/enet/unix.h \ 13 | include/enet/utility.h \ 14 | include/enet/win32.h 15 | 16 | lib_LTLIBRARIES = libenet.la 17 | libenet_la_SOURCES = callbacks.c compress.c host.c list.c packet.c peer.c protocol.c unix.c win32.c 18 | # see info '(libtool) Updating version info' before making a release 19 | libenet_la_LDFLAGS = $(AM_LDFLAGS) -version-info 7:0:0 20 | AM_CPPFLAGS = -I$(top_srcdir)/include 21 | 22 | ACLOCAL_AMFLAGS = -Im4 23 | -------------------------------------------------------------------------------- /enet/README: -------------------------------------------------------------------------------- 1 | Please visit the ENet homepage at http://enet.bespin.org for installation 2 | and usage instructions. 3 | 4 | If you obtained this package from github, the quick description on how to build 5 | is: 6 | 7 | # Generate the build system. 8 | 9 | autoreconf -vfi 10 | 11 | # Compile and install the library. 12 | 13 | ./configure && make && make install 14 | 15 | 16 | -------------------------------------------------------------------------------- /enet/callbacks.c: -------------------------------------------------------------------------------- 1 | /** 2 | @file callbacks.c 3 | @brief ENet callback functions 4 | */ 5 | #define ENET_BUILDING_LIB 1 6 | #include "enet/enet.h" 7 | 8 | static ENetCallbacks callbacks = { malloc, free, abort }; 9 | 10 | int 11 | enet_initialize_with_callbacks (ENetVersion version, const ENetCallbacks * inits) 12 | { 13 | if (version < ENET_VERSION_CREATE (1, 3, 0)) 14 | return -1; 15 | 16 | if (inits -> malloc != NULL || inits -> free != NULL) 17 | { 18 | if (inits -> malloc == NULL || inits -> free == NULL) 19 | return -1; 20 | 21 | callbacks.malloc = inits -> malloc; 22 | callbacks.free = inits -> free; 23 | } 24 | 25 | if (inits -> no_memory != NULL) 26 | callbacks.no_memory = inits -> no_memory; 27 | 28 | return enet_initialize (); 29 | } 30 | 31 | ENetVersion 32 | enet_linked_version (void) 33 | { 34 | return ENET_VERSION; 35 | } 36 | 37 | void * 38 | enet_malloc (size_t size) 39 | { 40 | void * memory = callbacks.malloc (size); 41 | 42 | if (memory == NULL) 43 | callbacks.no_memory (); 44 | 45 | return memory; 46 | } 47 | 48 | void 49 | enet_free (void * memory) 50 | { 51 | callbacks.free (memory); 52 | } 53 | 54 | -------------------------------------------------------------------------------- /enet/configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT([libenet], [1.3.12]) 2 | AC_CONFIG_SRCDIR([include/enet/enet.h]) 3 | AM_INIT_AUTOMAKE([foreign]) 4 | 5 | AC_CONFIG_MACRO_DIR([m4]) 6 | 7 | AC_PROG_CC 8 | AC_PROG_LIBTOOL 9 | 10 | AC_CHECK_FUNC(gethostbyaddr_r, [AC_DEFINE(HAS_GETHOSTBYADDR_R)]) 11 | AC_CHECK_FUNC(gethostbyname_r, [AC_DEFINE(HAS_GETHOSTBYNAME_R)]) 12 | AC_CHECK_FUNC(poll, [AC_DEFINE(HAS_POLL)]) 13 | AC_CHECK_FUNC(fcntl, [AC_DEFINE(HAS_FCNTL)]) 14 | AC_CHECK_FUNC(inet_pton, [AC_DEFINE(HAS_INET_PTON)]) 15 | AC_CHECK_FUNC(inet_ntop, [AC_DEFINE(HAS_INET_NTOP)]) 16 | 17 | AC_CHECK_MEMBER(struct msghdr.msg_flags, [AC_DEFINE(HAS_MSGHDR_FLAGS)], , [#include ]) 18 | 19 | AC_CHECK_TYPE(socklen_t, [AC_DEFINE(HAS_SOCKLEN_T)], , 20 | #include 21 | #include 22 | ) 23 | 24 | AC_CONFIG_FILES([Makefile 25 | libenet.pc]) 26 | AC_OUTPUT 27 | -------------------------------------------------------------------------------- /enet/docs/FAQ.dox: -------------------------------------------------------------------------------- 1 | /** 2 | @page FAQ Frequently Answered Questions 3 | 4 | @section Q1 Is ENet thread-safe? 5 | 6 | ENet does not use any significant global variables, the vast majority 7 | of state is encapsulated in the ENetHost structure. As such, as long 8 | as the application guards access to this structure, then ENet should 9 | operate fine in a multi-threaded environment. 10 | 11 | @section Q2 Isn't ENet just re-inventing TCP?! What's the point? 12 | 13 | In a perfect world, that would be true. But as many have found, using 14 | TCP either in lieu of or in conjunction with UDP can lead to all kinds 15 | of nightmares. TCP is a good, solid protocol, however it simply isn't 16 | up to the task of real-time games. Too much of TCP's implementation 17 | dictates a policy that isn't practical for games. If you want to use 18 | TCP, then do so -- this library is for people that either don't want 19 | to use TCP or have tried and ended up being discouraged with the 20 | performance. 21 | 22 | */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /enet/docs/html/FAQ.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: Frequently Answered Questions 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Frequently Answered Questions
42 |
43 |
44 |

45 | Is ENet thread-safe?

46 |

ENet does not use any significant global variables, the vast majority of state is encapsulated in the ENetHost structure. As such, as long as the application guards access to this structure, then ENet should operate fine in a multi-threaded environment.

47 |

48 | Isn't ENet just re-inventing TCP?! What's the point?

49 |

In a perfect world, that would be true. But as many have found, using TCP either in lieu of or in conjunction with UDP can lead to all kinds of nightmares. TCP is a good, solid protocol, however it simply isn't up to the task of real-time games. Too much of TCP's implementation dictates a policy that isn't practical for games. If you want to use TCP, then do so – this library is for people that either don't want to use TCP or have tried and ended up being discouraged with the performance.

50 |
51 | 52 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /enet/docs/html/IRCChannel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: ENet IRC Channel 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
ENet IRC Channel
42 |
43 |
44 |

Join the #enet channel on the freenode IRC network (irc.freenode.net) for real-time discussion about the ENet library.

45 |
46 | 47 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /enet/docs/html/License.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: License 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
License
42 |
43 |
44 |

Copyright (c) 2002-2014 Lee Salzman

45 |

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

46 |

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

47 |

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

48 |
49 | 50 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /enet/docs/html/MailingList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: ENet Mailing List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
ENet Mailing List
42 |
43 |
44 |

The enet-discuss list is for discussion of ENet, including bug reports or feature requests.

45 |
46 | 47 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /enet/docs/html/SourceDistro.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: Source Distribution 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Source Distribution
42 |
43 |
44 |

You can retrieve the source to ENet by downloading it in either .tar.gz form or accessing the github distribution directly.

45 |

The most recent stable release (1.3.12) can be downloaded here. The last release that is protocol compatible with the 1.2 series or earlier (1.2.5) can be downloaded here

46 |

You can find the most recent ENet source at the github repository.

47 |
48 | 49 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /enet/docs/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/bc_s.png -------------------------------------------------------------------------------- /enet/docs/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/bdwn.png -------------------------------------------------------------------------------- /enet/docs/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/closed.png -------------------------------------------------------------------------------- /enet/docs/html/dir_d44c64559bbebec7f509842c48db8b23.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: include Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 42 |
43 |
44 |
45 |
include Directory Reference
46 |
47 |
48 | 49 | 51 | 52 | 53 |

50 | Directories

directory  enet
 
54 |
55 | 56 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /enet/docs/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/doxygen.png -------------------------------------------------------------------------------- /enet/docs/html/dynsections.js: -------------------------------------------------------------------------------- 1 | function toggleVisibility(linkObj) 2 | { 3 | var base = $(linkObj).attr('id'); 4 | var summary = $('#'+base+'-summary'); 5 | var content = $('#'+base+'-content'); 6 | var trigger = $('#'+base+'-trigger'); 7 | var src=$(trigger).attr('src'); 8 | if (content.is(':visible')===true) { 9 | content.hide(); 10 | summary.show(); 11 | $(linkObj).addClass('closed').removeClass('opened'); 12 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); 13 | } else { 14 | content.show(); 15 | summary.hide(); 16 | $(linkObj).removeClass('closed').addClass('opened'); 17 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); 18 | } 19 | return false; 20 | } 21 | 22 | function updateStripes() 23 | { 24 | $('table.directory tr'). 25 | removeClass('even').filter(':visible:even').addClass('even'); 26 | } 27 | function toggleLevel(level) 28 | { 29 | $('table.directory tr').each(function(){ 30 | var l = this.id.split('_').length-1; 31 | var i = $('#img'+this.id.substring(3)); 32 | var a = $('#arr'+this.id.substring(3)); 33 | if (l 2 | 3 | 4 | 5 | 6 | 7 | enet: Data Fields - Functions 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 45 | 52 |
53 |
54 |   62 |
63 | 64 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /enet/docs/html/globals_defs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: Globals 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 | 54 |
55 |
56 |  
    57 |
  • ENET_HOST_TO_NET_16 58 | : unix.h 59 |
  • 60 |
  • ENET_HOST_TO_NET_32 61 | : unix.h 62 |
  • 63 |
  • ENET_NET_TO_HOST_16 64 | : unix.h 65 |
  • 66 |
  • ENET_NET_TO_HOST_32 67 | : unix.h 68 |
  • 69 |
70 |
71 | 72 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /enet/docs/html/globals_enum.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: Globals 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 | 54 |
55 |
56 |  
    57 |
  • _ENetEventType 58 | : enet.h 59 |
  • 60 |
  • _ENetPacketFlag 61 | : enet.h 62 |
  • 63 |
64 |
65 | 66 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /enet/docs/html/group__callbacks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: ENet internal callbacks 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 | Functions
42 |
43 |
44 |
45 |
46 | 47 | 49 | 51 | 52 | 54 | 55 |

48 | Functions

50 | void * enet_malloc (size_t)
 
53 | void enet_free (void *)
 
56 |

Detailed Description

57 |
58 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /enet/docs/html/group__private.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: ENet private implementation functions 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 | Modules
42 |
43 |
ENet private implementation functions
44 |
45 |
46 | 47 | 49 | 50 | 51 | 52 | 53 |

48 | Modules

 ENet internal callbacks
 
 ENet linked list utility functions
 
54 |

Detailed Description

55 |
56 | 57 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /enet/docs/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: enet 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
enet
42 |
43 |
44 |
http://enet.bespin.org

45 |

ENet's purpose is to provide a relatively thin, simple and robust network communication layer on top of UDP (User Datagram Protocol). The primary feature it provides is optional reliable, in-order delivery of packets.

46 |

ENet omits certain higher level networking features such as authentication, lobbying, server discovery, encryption, or other similar tasks that are particularly application specific so that the library remains flexible, portable, and easily embeddable.

47 |

Features and Architecture

48 |

Source Distribution

49 |

Installation

50 |

Tutorial

51 |

ENet Mailing List

52 |

ENet IRC Channel

53 |

Frequently Answered Questions

54 |

License

55 |
56 | 57 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /enet/docs/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/nav_f.png -------------------------------------------------------------------------------- /enet/docs/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/nav_g.png -------------------------------------------------------------------------------- /enet/docs/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/nav_h.png -------------------------------------------------------------------------------- /enet/docs/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/open.png -------------------------------------------------------------------------------- /enet/docs/html/structENetBuffer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: ENetBuffer Struct Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 45 |
46 |
47 | 49 |
50 |
ENetBuffer Struct Reference
51 |
52 |
53 | 54 | 56 | 58 | 59 | 61 | 62 |

55 | Data Fields

57 | void * data
 
60 | size_t dataLength
 
63 |
The documentation for this struct was generated from the following files: 67 |
68 | 69 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /enet/docs/html/struct__ENetList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: _ENetList Struct Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 45 |
46 |
47 | 49 |
50 |
_ENetList Struct Reference
51 |
52 |
53 | 54 | 56 | 58 | 59 |

55 | Data Fields

57 | ENetListNode sentinel
 
60 |
The documentation for this struct was generated from the following file: 63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /enet/docs/html/struct__ENetListNode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: _ENetListNode Struct Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 45 |
46 |
47 | 49 |
50 |
_ENetListNode Struct Reference
51 |
52 |
53 | 54 | 56 | 58 | 59 | 61 | 62 |

55 | Data Fields

57 | struct _ENetListNodenext
 
60 | struct _ENetListNodeprevious
 
63 |
The documentation for this struct was generated from the following file: 66 |
67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /enet/docs/html/struct__ENetProtocolDisconnect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: _ENetProtocolDisconnect Struct Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 45 |
46 |
47 | 49 |
50 |
_ENetProtocolDisconnect Struct Reference
51 |
52 |
53 | 54 | 56 | 58 | 59 | 61 | 62 |

55 | Data Fields

57 | ENetProtocolCommandHeader header
 
60 | enet_uint32 data
 
63 |
The documentation for this struct was generated from the following file: 66 |
67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /enet/docs/html/struct__ENetProtocolHeader.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: _ENetProtocolHeader Struct Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 45 |
46 |
47 | 49 |
50 |
_ENetProtocolHeader Struct Reference
51 |
52 |
53 | 54 | 56 | 58 | 59 | 61 | 62 |

55 | Data Fields

57 | enet_uint16 peerID
 
60 | enet_uint16 sentTime
 
63 |
The documentation for this struct was generated from the following file: 66 |
67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /enet/docs/html/struct__ENetProtocolPing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: _ENetProtocolPing Struct Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 45 |
46 |
47 | 49 |
50 |
_ENetProtocolPing Struct Reference
51 |
52 |
53 | 54 | 56 | 58 | 59 |

55 | Data Fields

57 | ENetProtocolCommandHeader header
 
60 |
The documentation for this struct was generated from the following file: 63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /enet/docs/html/struct__ENetProtocolSendReliable.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: _ENetProtocolSendReliable Struct Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 45 |
46 |
47 | 49 |
50 |
_ENetProtocolSendReliable Struct Reference
51 |
52 |
53 | 54 | 56 | 58 | 59 | 61 | 62 |

55 | Data Fields

57 | ENetProtocolCommandHeader header
 
60 | enet_uint16 dataLength
 
63 |
The documentation for this struct was generated from the following file: 66 |
67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /enet/docs/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/sync_off.png -------------------------------------------------------------------------------- /enet/docs/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/sync_on.png -------------------------------------------------------------------------------- /enet/docs/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/tab_a.png -------------------------------------------------------------------------------- /enet/docs/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/tab_b.png -------------------------------------------------------------------------------- /enet/docs/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/tab_h.png -------------------------------------------------------------------------------- /enet/docs/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/docs/html/tab_s.png -------------------------------------------------------------------------------- /enet/docs/html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 7 | } 8 | 9 | .tabs2 { 10 | font-size: 10px; 11 | } 12 | .tabs3 { 13 | font-size: 9px; 14 | } 15 | 16 | .tablist { 17 | margin: 0; 18 | padding: 0; 19 | display: table; 20 | } 21 | 22 | .tablist li { 23 | float: left; 24 | display: table-cell; 25 | background-image: url('tab_b.png'); 26 | line-height: 36px; 27 | list-style: none; 28 | } 29 | 30 | .tablist a { 31 | display: block; 32 | padding: 0 20px; 33 | font-weight: bold; 34 | background-image:url('tab_s.png'); 35 | background-repeat:no-repeat; 36 | background-position:right; 37 | color: #283A5D; 38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 39 | text-decoration: none; 40 | outline: none; 41 | } 42 | 43 | .tabs3 .tablist a { 44 | padding: 0 10px; 45 | } 46 | 47 | .tablist a:hover { 48 | background-image: url('tab_h.png'); 49 | background-repeat:repeat-x; 50 | color: #fff; 51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 52 | text-decoration: none; 53 | } 54 | 55 | .tablist li.current a { 56 | background-image: url('tab_a.png'); 57 | background-repeat:repeat-x; 58 | color: #fff; 59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 60 | } 61 | -------------------------------------------------------------------------------- /enet/docs/html/utility_8h.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: utility.h File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 | 48 |
49 |
50 |
51 | Macros
52 |
53 |
utility.h File Reference
54 |
55 |
56 | 57 |

ENet utility header. 58 | More...

59 | 60 |

Go to the source code of this file.

61 | 62 | 64 | 66 | 67 | 69 | 70 |

63 | Macros

65 | #define ENET_MAX(x, y)   ((x) > (y) ? (x) : (y))
 
68 | #define ENET_MIN(x, y)   ((x) < (y) ? (x) : (y))
 
71 |
72 | 73 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /enet/docs/html/win32_8c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | enet: win32.c File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
enet 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 |
47 |
win32.c File Reference
48 |
49 |
50 | 51 |

ENet Win32 system specific functions. 52 | More...

53 |
54 | 55 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /enet/docs/install.dox: -------------------------------------------------------------------------------- 1 | /** 2 | @page Installation Installation 3 | 4 | ENet should be trivially simple to integrate with most applications. 5 | First, make sure you download the latest source distribution here @ref 6 | SourceDistro. 7 | 8 | @section Unix Unix-like Operating Systems 9 | 10 | If you are using an ENet release, then you should simply be able to build it 11 | by doing the following: 12 | 13 | ./configure && make && make install 14 | 15 | If you obtained the package from github, you must have automake and autoconf 16 | available to generate the build system first by doing the following command 17 | before using the above mentioned build procedure: 18 | 19 | autoreconf -vfi 20 | 21 | 22 | @subsection SolarisBSD Solaris and BSD 23 | 24 | When building ENet under Solaris, you must specify the -lsocket and 25 | -lnsl parameters to your compiler to ensure that the sockets library 26 | is linked in. 27 | 28 | @section Windows Microsoft Windows 29 | 30 | You may simply use the included "enet.lib" or "enet64.lib" static libraries. 31 | However, if you wish to build the library yourself, then the following 32 | instructions apply: 33 | 34 | There is an included MSVC 6 project (enet.dsp) which you may use to 35 | build a suitable library file. Alternatively, you may simply drag all 36 | the ENet source files into your main project. 37 | 38 | You will have to link to the Winsock2 libraries, so make sure to add 39 | ws2_32.lib and winmm.lib to your library list (Project Settings | Link | 40 | Object/library modules). 41 | 42 | @subsection enet.dsp Building with the included enet.dsp 43 | 44 | Load the included enet.dsp. MSVC may ask you to convert it if you 45 | are on a newer version of MSVC - just allow the conversion and save 46 | the resulting project as "enet" or similar. After you build this 47 | project, it will output an "enet.lib" file to either the "Debug/" 48 | or "Release/" directory, depending on which configuration you have 49 | selected to build. By default, it should produce "Debug/enet.lib". 50 | 51 | You may then copy the resulting "enet.lib" file and the header files 52 | found in the "include/" directory to your other projects and add it to 53 | their library lists. Make sure to also link against "ws2_32.lib" and 54 | "winmm.lib" as described above. 55 | 56 | @subsection DLL DLL 57 | 58 | If you wish to build ENet as a DLL you must first define ENET_DLL 59 | within the project (Project Settings | C/C++ | Preprocessor | 60 | Preprocessor definitions) or, more invasively, simply define ENET_DLL 61 | at the top of enet.h. 62 | 63 | */ 64 | 65 | -------------------------------------------------------------------------------- /enet/docs/license.dox: -------------------------------------------------------------------------------- 1 | /** 2 | @page License License 3 | 4 | Copyright (c) 2002-2014 Lee Salzman 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | 25 | */ 26 | 27 | -------------------------------------------------------------------------------- /enet/docs/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** @mainpage enet 2 |
http://enet.bespin.org
3 |
4 | 5 | ENet's purpose is to provide a relatively thin, simple and robust 6 | network communication layer on top of UDP (User Datagram Protocol). 7 | The primary feature it provides is optional reliable, in-order 8 | delivery of packets. 9 | 10 | ENet omits certain higher level networking features such as authentication, 11 | lobbying, server discovery, encryption, or other similar tasks that are 12 | particularly application specific so that the library remains flexible, 13 | portable, and easily embeddable. 14 | 15 | @ref Features 16 | 17 | @ref SourceDistro 18 | 19 | @ref Installation 20 | 21 | @ref Tutorial 22 | 23 | @ref MailingList 24 | 25 | @ref IRCChannel 26 | 27 | @ref FAQ 28 | 29 | @ref License 30 | 31 | */ 32 | 33 | /** 34 | @page SourceDistro Source Distribution 35 | 36 | You can retrieve the source to ENet by downloading it in either .tar.gz form 37 | or accessing the github distribution directly. 38 | 39 | The most recent stable release (1.3.12) can be downloaded here. 40 | The last release that is protocol compatible with the 1.2 series or earlier (1.2.5) can be downloaded here 41 | 42 | You can find the most recent ENet source at the github repository. 43 | 44 | */ 45 | 46 | /** 47 | @page MailingList ENet Mailing List 48 | 49 | The enet-discuss list is for discussion of ENet, including bug reports or feature requests. 50 | 51 | */ 52 | 53 | /** 54 | @page IRCChannel ENet IRC Channel 55 | 56 | Join the \#enet channel on the freenode IRC network (irc.freenode.net) for real-time discussion about the ENet library. 57 | 58 | */ 59 | 60 | -------------------------------------------------------------------------------- /enet/enet.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/enet.lib -------------------------------------------------------------------------------- /enet/enet64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/enet64.lib -------------------------------------------------------------------------------- /enet/enet_dll.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 86 | 87 | -------------------------------------------------------------------------------- /enet/include/enet/callbacks.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file callbacks.h 3 | @brief ENet callbacks 4 | */ 5 | #ifndef __ENET_CALLBACKS_H__ 6 | #define __ENET_CALLBACKS_H__ 7 | 8 | #include 9 | 10 | typedef struct _ENetCallbacks 11 | { 12 | void * (ENET_CALLBACK * malloc) (size_t size); 13 | void (ENET_CALLBACK * free) (void * memory); 14 | void (ENET_CALLBACK * no_memory) (void); 15 | } ENetCallbacks; 16 | 17 | /** @defgroup callbacks ENet internal callbacks 18 | @{ 19 | @ingroup private 20 | */ 21 | extern void * enet_malloc (size_t); 22 | extern void enet_free (void *); 23 | 24 | /** @} */ 25 | 26 | #endif /* __ENET_CALLBACKS_H__ */ 27 | 28 | -------------------------------------------------------------------------------- /enet/include/enet/list.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file list.h 3 | @brief ENet list management 4 | */ 5 | #ifndef __ENET_LIST_H__ 6 | #define __ENET_LIST_H__ 7 | 8 | #include 9 | 10 | typedef struct _ENetListNode 11 | { 12 | struct _ENetListNode * next; 13 | struct _ENetListNode * previous; 14 | } ENetListNode; 15 | 16 | typedef ENetListNode * ENetListIterator; 17 | 18 | typedef struct _ENetList 19 | { 20 | ENetListNode sentinel; 21 | } ENetList; 22 | 23 | extern void enet_list_clear (ENetList *); 24 | 25 | extern ENetListIterator enet_list_insert (ENetListIterator, void *); 26 | extern void * enet_list_remove (ENetListIterator); 27 | extern ENetListIterator enet_list_move (ENetListIterator, void *, void *); 28 | 29 | extern size_t enet_list_size (ENetList *); 30 | 31 | #define enet_list_begin(list) ((list) -> sentinel.next) 32 | #define enet_list_end(list) (& (list) -> sentinel) 33 | 34 | #define enet_list_empty(list) (enet_list_begin (list) == enet_list_end (list)) 35 | 36 | #define enet_list_next(iterator) ((iterator) -> next) 37 | #define enet_list_previous(iterator) ((iterator) -> previous) 38 | 39 | #define enet_list_front(list) ((void *) (list) -> sentinel.next) 40 | #define enet_list_back(list) ((void *) (list) -> sentinel.previous) 41 | 42 | #endif /* __ENET_LIST_H__ */ 43 | 44 | -------------------------------------------------------------------------------- /enet/include/enet/time.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file time.h 3 | @brief ENet time constants and macros 4 | */ 5 | #ifndef __ENET_TIME_H__ 6 | #define __ENET_TIME_H__ 7 | 8 | #define ENET_TIME_OVERFLOW 86400000 9 | 10 | #define ENET_TIME_LESS(a, b) ((a) - (b) >= ENET_TIME_OVERFLOW) 11 | #define ENET_TIME_GREATER(a, b) ((b) - (a) >= ENET_TIME_OVERFLOW) 12 | #define ENET_TIME_LESS_EQUAL(a, b) (! ENET_TIME_GREATER (a, b)) 13 | #define ENET_TIME_GREATER_EQUAL(a, b) (! ENET_TIME_LESS (a, b)) 14 | 15 | #define ENET_TIME_DIFFERENCE(a, b) ((a) - (b) >= ENET_TIME_OVERFLOW ? (b) - (a) : (a) - (b)) 16 | 17 | #endif /* __ENET_TIME_H__ */ 18 | 19 | -------------------------------------------------------------------------------- /enet/include/enet/types.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file types.h 3 | @brief type definitions for ENet 4 | */ 5 | #ifndef __ENET_TYPES_H__ 6 | #define __ENET_TYPES_H__ 7 | 8 | typedef unsigned char enet_uint8; /**< unsigned 8-bit type */ 9 | typedef unsigned short enet_uint16; /**< unsigned 16-bit type */ 10 | typedef unsigned int enet_uint32; /**< unsigned 32-bit type */ 11 | 12 | #endif /* __ENET_TYPES_H__ */ 13 | 14 | -------------------------------------------------------------------------------- /enet/include/enet/unix.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file unix.h 3 | @brief ENet Unix header 4 | */ 5 | #ifndef __ENET_UNIX_H__ 6 | #define __ENET_UNIX_H__ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #ifdef MSG_MAXIOVLEN 16 | #define ENET_BUFFER_MAXIMUM MSG_MAXIOVLEN 17 | #endif 18 | 19 | typedef int ENetSocket; 20 | 21 | #define ENET_SOCKET_NULL -1 22 | 23 | #define ENET_HOST_TO_NET_16(value) (htons (value)) /**< macro that converts host to net byte-order of a 16-bit value */ 24 | #define ENET_HOST_TO_NET_32(value) (htonl (value)) /**< macro that converts host to net byte-order of a 32-bit value */ 25 | 26 | #define ENET_NET_TO_HOST_16(value) (ntohs (value)) /**< macro that converts net to host byte-order of a 16-bit value */ 27 | #define ENET_NET_TO_HOST_32(value) (ntohl (value)) /**< macro that converts net to host byte-order of a 32-bit value */ 28 | 29 | typedef struct 30 | { 31 | void * data; 32 | size_t dataLength; 33 | } ENetBuffer; 34 | 35 | #define ENET_CALLBACK 36 | 37 | #define ENET_API extern 38 | 39 | typedef fd_set ENetSocketSet; 40 | 41 | #define ENET_SOCKETSET_EMPTY(sockset) FD_ZERO (& (sockset)) 42 | #define ENET_SOCKETSET_ADD(sockset, socket) FD_SET (socket, & (sockset)) 43 | #define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLR (socket, & (sockset)) 44 | #define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset)) 45 | 46 | #endif /* __ENET_UNIX_H__ */ 47 | 48 | -------------------------------------------------------------------------------- /enet/include/enet/utility.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file utility.h 3 | @brief ENet utility header 4 | */ 5 | #ifndef __ENET_UTILITY_H__ 6 | #define __ENET_UTILITY_H__ 7 | 8 | #define ENET_MAX(x, y) ((x) > (y) ? (x) : (y)) 9 | #define ENET_MIN(x, y) ((x) < (y) ? (x) : (y)) 10 | 11 | #endif /* __ENET_UTILITY_H__ */ 12 | 13 | -------------------------------------------------------------------------------- /enet/include/enet/win32.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file win32.h 3 | @brief ENet Win32 header 4 | */ 5 | #ifndef __ENET_WIN32_H__ 6 | #define __ENET_WIN32_H__ 7 | 8 | #ifdef _MSC_VER 9 | #ifdef ENET_BUILDING_LIB 10 | #pragma warning (disable: 4267) // size_t to int conversion 11 | #pragma warning (disable: 4244) // 64bit to 32bit int 12 | #pragma warning (disable: 4018) // signed/unsigned mismatch 13 | #pragma warning (disable: 4146) // unary minus operator applied to unsigned type 14 | #endif 15 | #endif 16 | 17 | #include 18 | #include 19 | 20 | typedef SOCKET ENetSocket; 21 | 22 | #define ENET_SOCKET_NULL INVALID_SOCKET 23 | 24 | #define ENET_HOST_TO_NET_16(value) (htons (value)) 25 | #define ENET_HOST_TO_NET_32(value) (htonl (value)) 26 | 27 | #define ENET_NET_TO_HOST_16(value) (ntohs (value)) 28 | #define ENET_NET_TO_HOST_32(value) (ntohl (value)) 29 | 30 | typedef struct 31 | { 32 | size_t dataLength; 33 | void * data; 34 | } ENetBuffer; 35 | 36 | #define ENET_CALLBACK __cdecl 37 | 38 | #ifdef ENET_DLL 39 | #ifdef ENET_BUILDING_LIB 40 | #define ENET_API __declspec( dllexport ) 41 | #else 42 | #define ENET_API __declspec( dllimport ) 43 | #endif /* ENET_BUILDING_LIB */ 44 | #else /* !ENET_DLL */ 45 | #define ENET_API extern 46 | #endif /* ENET_DLL */ 47 | 48 | typedef fd_set ENetSocketSet; 49 | 50 | #define ENET_SOCKETSET_EMPTY(sockset) FD_ZERO (& (sockset)) 51 | #define ENET_SOCKETSET_ADD(sockset, socket) FD_SET (socket, & (sockset)) 52 | #define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLR (socket, & (sockset)) 53 | #define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset)) 54 | 55 | #endif /* __ENET_WIN32_H__ */ 56 | 57 | 58 | -------------------------------------------------------------------------------- /enet/libenet.pc: -------------------------------------------------------------------------------- 1 | prefix=/usr/local 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: libenet 7 | Description: Low-latency UDP networking library supporting optional reliability 8 | Version: 1.3.12 9 | Cflags: -I${includedir} 10 | Libs: -L${libdir} -lenet 11 | -------------------------------------------------------------------------------- /enet/libenet.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: @PACKAGE_NAME@ 7 | Description: Low-latency UDP networking library supporting optional reliability 8 | Version: @PACKAGE_VERSION@ 9 | Cflags: -I${includedir} 10 | Libs: -L${libdir} -lenet 11 | -------------------------------------------------------------------------------- /enet/list.c: -------------------------------------------------------------------------------- 1 | /** 2 | @file list.c 3 | @brief ENet linked list functions 4 | */ 5 | #define ENET_BUILDING_LIB 1 6 | #include "enet/enet.h" 7 | 8 | /** 9 | @defgroup list ENet linked list utility functions 10 | @ingroup private 11 | @{ 12 | */ 13 | void 14 | enet_list_clear (ENetList * list) 15 | { 16 | list -> sentinel.next = & list -> sentinel; 17 | list -> sentinel.previous = & list -> sentinel; 18 | } 19 | 20 | ENetListIterator 21 | enet_list_insert (ENetListIterator position, void * data) 22 | { 23 | ENetListIterator result = (ENetListIterator) data; 24 | 25 | result -> previous = position -> previous; 26 | result -> next = position; 27 | 28 | result -> previous -> next = result; 29 | position -> previous = result; 30 | 31 | return result; 32 | } 33 | 34 | void * 35 | enet_list_remove (ENetListIterator position) 36 | { 37 | position -> previous -> next = position -> next; 38 | position -> next -> previous = position -> previous; 39 | 40 | return position; 41 | } 42 | 43 | ENetListIterator 44 | enet_list_move (ENetListIterator position, void * dataFirst, void * dataLast) 45 | { 46 | ENetListIterator first = (ENetListIterator) dataFirst, 47 | last = (ENetListIterator) dataLast; 48 | 49 | first -> previous -> next = last -> next; 50 | last -> next -> previous = first -> previous; 51 | 52 | first -> previous = position -> previous; 53 | last -> next = position; 54 | 55 | first -> previous -> next = first; 56 | position -> previous = last; 57 | 58 | return first; 59 | } 60 | 61 | size_t 62 | enet_list_size (ENetList * list) 63 | { 64 | size_t size = 0; 65 | ENetListIterator position; 66 | 67 | for (position = enet_list_begin (list); 68 | position != enet_list_end (list); 69 | position = enet_list_next (position)) 70 | ++ size; 71 | 72 | return size; 73 | } 74 | 75 | /** @} */ 76 | -------------------------------------------------------------------------------- /enet/m4/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/enet/m4/.keep -------------------------------------------------------------------------------- /enet/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 3337 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.2]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3337]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.2' 20 | macro_revision='1.3337' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /item_classes.txt: -------------------------------------------------------------------------------- 1 | +item_ammost.h 2 | +item_amuletst.h 3 | +item_animaltrapst.h 4 | +item_anvilst.h 5 | +item_armorst.h 6 | +item_armorstandst.h 7 | +item_backpackst.h 8 | +item_ballistaarrowheadst.h 9 | +item_ballistapartsst.h 10 | +item_barrelst.h 11 | +item_barst.h 12 | +item_bedst.h 13 | +item_binst.h 14 | +item_blocksst.h 15 | +item_bookst.h 16 | +item_boulderst.h 17 | +item_boxst.h 18 | +item_braceletst.h 19 | +item_branchst.h 20 | +item_bucketst.h 21 | +item_cabinetst.h 22 | +item_cagest.h 23 | +item_catapultpartsst.h 24 | +item_chainst.h 25 | +item_chairst.h 26 | +item_cheesest.h 27 | +item_clothst.h 28 | +item_coffinst.h 29 | +item_coinst.h 30 | +item_corpsepiecest.h 31 | +item_corpsest.h 32 | +item_crownst.h 33 | +item_crutchst.h 34 | +item_doorst.h 35 | -item_drinkst.h 36 | +item_earringst.h 37 | +item_eggst.h 38 | +item_figurinest.h 39 | +item_fish_rawst.h 40 | +item_fishst.h 41 | +item_flaskst.h 42 | +item_floodgatest.h 43 | +item_foodst.h 44 | +item_gemst.h 45 | +item_globst.h 46 | +item_glovesst.h 47 | +item_gobletst.h 48 | +item_gratest.h 49 | +item_hatch_coverst.h 50 | +item_helmst.h 51 | +item_instrumentst.h 52 | -item_liquid_miscst.h 53 | +item_meatst.h 54 | +item_millstonest.h 55 | +item_orthopedic_castst.h 56 | +item_pantsst.h 57 | +item_petst.h 58 | +item_pipe_sectionst.h 59 | +item_plant_growthst.h 60 | +item_plantst.h 61 | -item_powder_miscst.h 62 | +item_quernst.h 63 | +item_quiverst.h 64 | +item_remainsst.h 65 | +item_ringst.h 66 | +item_rockst.h 67 | +item_roughst.h 68 | +item_scepterst.h 69 | +item_seedsst.h 70 | +item_sheetst.h 71 | +item_shieldst.h 72 | +item_shoesst.h 73 | +item_siegeammost.h 74 | +item_skin_tannedst.h 75 | +item_slabst.h 76 | +item_smallgemst.h 77 | +item_splintst.h 78 | +item_statuest.h 79 | +item_tablest.h 80 | +item_threadst.h 81 | +item_toolst.h 82 | +item_totemst.h 83 | +item_toyst.h 84 | +item_traction_benchst.h 85 | +item_trapcompst.h 86 | +item_trappartsst.h 87 | +item_verminst.h 88 | +item_weaponrackst.h 89 | +item_weaponst.h 90 | +item_windowst.h 91 | +item_woodst.h -------------------------------------------------------------------------------- /lua/alerts.lua: -------------------------------------------------------------------------------- 1 | function alert_id2index(id) 2 | for i,v in ipairs(df.global.ui.alerts.list) do 3 | if v.id == id then 4 | return i 5 | end 6 | end 7 | 8 | return -1 9 | end 10 | 11 | function alert_find_by_id(id) 12 | for i,v in ipairs(df.global.ui.alerts.list) do 13 | if v.id == id then 14 | return v 15 | end 16 | end 17 | 18 | return nil 19 | end 20 | 21 | --luacheck: in= 22 | function alerts_get_list() 23 | local list = {} 24 | 25 | for i,v in ipairs(df.global.ui.alerts.list) do 26 | local squads = find_fortress_squads() 27 | local num_alert_squads = 0 28 | for j,w in ipairs(squads) do 29 | if w.cur_alert_idx == i then 30 | num_alert_squads = num_alert_squads + 1 31 | end 32 | end 33 | 34 | --todo: don't need v.name here ? 35 | table.insert(list, { alertname(v), v.id, v.name, num_alert_squads, #v.burrows }) 36 | end 37 | 38 | return { list, df.global.ui.alerts.civ_alert_idx } 39 | end 40 | 41 | --luacheck: in=number 42 | function alerts_set_civ(id) 43 | local idx = alert_id2index(id) 44 | if idx == -1 then 45 | return 46 | end 47 | 48 | df.global.ui.alerts.civ_alert_idx = idx 49 | 50 | return true 51 | end 52 | 53 | --luacheck: in= 54 | function alerts_add() 55 | execute_with_military_screen(function(ws) 56 | gui.simulateInput(ws, K'D_MILITARY_ALERTS') 57 | gui.simulateInput(ws, K'D_MILITARY_ALERTS_ADD') 58 | end) 59 | end 60 | 61 | --luacheck: in=number 62 | function alert_delete(id) 63 | -- disallow to delete Inactive alert 64 | if id == 0 then 65 | return 66 | end 67 | 68 | local idx = alert_id2index(id) 69 | if idx == -1 then 70 | return 71 | end 72 | 73 | execute_with_military_screen(function(ws) 74 | gui.simulateInput(ws, K'D_MILITARY_ALERTS') 75 | ws.layer_objects[0].cursor = idx --hint:df.layer_object_listst 76 | gui.simulateInput(ws, K'D_MILITARY_ALERTS_DELETE') 77 | gui.simulateInput(ws, K'MENU_CONFIRM') 78 | end) 79 | 80 | return true 81 | end 82 | 83 | --luacheck: in=number 84 | function alert_get_info(id) 85 | local idx = alert_id2index(id) 86 | if idx == -1 then 87 | return 88 | end 89 | 90 | local alert = df.global.ui.alerts.list[idx] 91 | 92 | local squads = {} 93 | for i,squad in ipairs(find_fortress_squads()) do 94 | local name = squadname(squad) 95 | local enabled = squad.cur_alert_idx == idx 96 | 97 | table.insert(squads, { name, squad.id, enabled }) 98 | end 99 | 100 | local burrows = {} 101 | for i,burrow in ipairs(df.global.ui.burrows.list) do 102 | local name = burrowname(burrow) 103 | local enabled = utils.binsearch(alert.burrows, burrow.id) ~= nil 104 | 105 | table.insert(burrows, { name, burrow.id, enabled }) 106 | end 107 | 108 | return { alertname(alert), alert.id, alert.name, squads, burrows } 109 | end 110 | 111 | --luacheck: in=number,number,bool 112 | function alert_set_burrow(id, burrowid, enabled) 113 | local alert = alert_find_by_id(id) 114 | if not alert then 115 | error('no alert '..tostring(id)) 116 | end 117 | 118 | if istrue(enabled) then 119 | utils.insert_sorted(alert.burrows, burrowid) 120 | else 121 | utils.erase_sorted(alert.burrows, burrowid) 122 | end 123 | end 124 | 125 | --luacheck: in=number,string 126 | function alert_set_name(id, name) 127 | local alert = alert_find_by_id(id) 128 | if not alert then 129 | error('no alert '..tostring(id)) 130 | end 131 | 132 | alert.name = dfhack.utf2df(name) 133 | 134 | return true 135 | end 136 | -------------------------------------------------------------------------------- /lua/compat.lua: -------------------------------------------------------------------------------- 1 | if df_ver >= 4705 and df_ver <= 4799 then --dfver:4705-4799 2 | require 'remote.compat_47' 3 | end 4 | -------------------------------------------------------------------------------- /lua/compat_47.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/lua/compat_47.lua -------------------------------------------------------------------------------- /lua/dfaas.lua: -------------------------------------------------------------------------------- 1 | --luacheck: in=string,string 2 | function dfaas_get_status(clientver, pwd) 3 | local idle_time = os.time() - STATE.last_cmd_time 4 | 5 | return { setup_get_server_info(clientver, pwd), idle_time } 6 | end 7 | 8 | --luacheck: in=string 9 | function dfaas_save_game(pwd) 10 | if not native.verify_pwd(pwd or '') then 11 | error('invalid password') 12 | end 13 | 14 | --todo: need to return to main screen! 15 | 16 | save_game() 17 | return true 18 | end 19 | 20 | --luacheck: in=string 21 | function dfaas_save_done(pwd) 22 | if not native.verify_pwd(pwd or '') then 23 | error('invalid password') 24 | end 25 | 26 | return (df.global.ui.main.autosave_request ~= true) 27 | end 28 | -------------------------------------------------------------------------------- /lua/kitchen.lua: -------------------------------------------------------------------------------- 1 | function set_restriction(item_type, item_subtype, mat_type, mat_index, restricted) 2 | local k = df.global.ui.kitchen 3 | 4 | for i,v in ipairs(k.item_types) do 5 | if v == item_type and k.item_subtypes[i] == item_subtype and 6 | k.mat_types[i] == mat_type and k.mat_indices[i] == mat_index then 7 | if restricted ~= 0 then 8 | k.exc_types[i] = restricted 9 | else 10 | k.item_types:erase(i) 11 | k.item_subtypes:erase(i) 12 | k.mat_types:erase(i) 13 | k.mat_indices:erase(i) 14 | k.exc_types:erase(i) 15 | end 16 | 17 | return 18 | end 19 | end 20 | 21 | k.item_types:insert(#k.item_types, item_type) 22 | k.item_subtypes:insert(#k.item_subtypes, item_subtype) 23 | k.mat_types:insert(#k.mat_types, mat_type) 24 | k.mat_indices:insert(#k.mat_indices, mat_index) 25 | k.exc_types:insert(#k.exc_types, restricted) 26 | end 27 | 28 | --luacheck: in= 29 | function kitchen_get_data() 30 | return execute_with_status_page(status_pages.Kitchen, function(ws) 31 | local ws = ws --as:df.viewscreen_kitchenprefst 32 | local ret = { { 'Plants', {} }, { 'Seeds', {} }, { 'Drinks', {} }, { 'Meat', {} } } 33 | 34 | for i,cat in ipairs(ret) do 35 | for j,v in ipairs(ws.item_str[i-1]) do 36 | local title = string.utf8capitalize(dfhack.df2utf(v.value)) 37 | local id = { ws.item_type[i-1][j], ws.item_subtype[i-1][j], ws.mat_type[i-1][j], ws.mat_index[i-1][j] } 38 | 39 | table.insert(ret[i][2], { title, ws.count[i-1][j], whole(ws.forbidden[i-1][j]), whole(ws.possible[i-1][j]), id }) 40 | end 41 | end 42 | 43 | local precision = df.global.ui.nobles.bookkeeper_precision 44 | table.insert(ret, precision) 45 | 46 | return ret 47 | end) 48 | end 49 | 50 | --luacheck: in=number[],bool 51 | function kitchen_set(id, restricted) 52 | set_restriction(id[1], id[2], id[3], id[4], restricted) 53 | return true 54 | end 55 | 56 | --print(pcall(function() return json:encode(kitchen_get_data()) end)) -------------------------------------------------------------------------------- /lua/military.lua: -------------------------------------------------------------------------------- 1 | require 'remote.alerts' 2 | require 'remote.squads' 3 | require 'remote.equipment' 4 | require 'remote.ammunition' 5 | require 'remote.uniforms' 6 | require 'remote.schedule' 7 | -------------------------------------------------------------------------------- /lua/stone.lua: -------------------------------------------------------------------------------- 1 | function stone_is_economic(raw) 2 | return (#raw.economic_uses>0 and raw.material.flags.IS_STONE) or raw.flags.METAL_ORE 3 | or raw.id == 'RAW_ADAMANTINE' or raw.id == 'OBSIDIAN' 4 | end 5 | 6 | function stone_is_other(raw) 7 | return #raw.economic_uses==0 and raw.material.flags.IS_STONE and not raw.flags.METAL_ORE and not raw.material.flags.NO_STONE_STOCKPILE 8 | and raw.id ~= 'RAW_ADAMANTINE' 9 | end 10 | 11 | --luacheck: in= 12 | function stone_get() 13 | local economic = {} 14 | local other = {} 15 | 16 | for i,raw in ipairs(df.global.world.raws.inorganics) do 17 | local mat = raw.material 18 | local name = capitalize(#mat.stone_name > 0 and mat.stone_name or mat.state_name[0]) 19 | local magmasafe = mat.heat.ignite_point > 12000 and mat.heat.melting_point > 12000 20 | local restricted = istrue(df.global.ui.economic_stone[i]) 21 | local flags = packbits(restricted,magmasafe) 22 | 23 | if stone_is_economic(raw) then 24 | table.insert(economic, { name, i, flags }) 25 | elseif stone_is_other(raw) then 26 | table.insert(other, { name, i, flags }) 27 | end 28 | end 29 | 30 | table.sort(economic, function(a,b) return a[1] < b[1] end) 31 | table.sort(other, function(a,b) return a[1] < b[1] end) 32 | 33 | return { economic, other } 34 | end 35 | 36 | --luacheck: in=number,bool 37 | function stone_set(idx, eco) 38 | df.global.ui.economic_stone[idx] = istrue(eco) and 1 or 0 39 | 40 | return true 41 | end -------------------------------------------------------------------------------- /lua/version.lua: -------------------------------------------------------------------------------- 1 | return '3.0.0-dev' -------------------------------------------------------------------------------- /lua/worldmap.lua: -------------------------------------------------------------------------------- 1 | --luacheck: in= 2 | function worldmap_enter() 3 | return execute_with_main_mode(df.ui_sidebar_mode.Default, function(ws) 4 | gui.simulateInput(ws, K'D_CIVLIST') 5 | return true 6 | end, true) 7 | end 8 | -------------------------------------------------------------------------------- /nopoll-win/include/nopoll_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * noPoll Library nopoll_config.h 3 | * Platform dependant definitions for Win32 platform. 4 | * 5 | * This file is maintained manually for those people that do not 6 | * compile nopoll using autoconf. It should look really similar to 7 | * nopoll_config.h file created on a i386 linux platform but changing 8 | * NOPOLL_OS_UNIX to NOPOLL_OS_WIN32 (at least for now). 9 | * 10 | * For commercial support on build WebSocket enabled solutions contact us: 11 | * 12 | * Postal address: 13 | * Advanced Software Production Line, S.L. 14 | * Edificio Alius A, Oficina 102, 15 | * C/ Antonio Suarez Nº 10, 16 | * Alcalá de Henares 28802 Madrid 17 | * Spain 18 | * 19 | * Email address: 20 | * info@aspl.es - http://www.aspl.es/nopoll 21 | * 22 | */ 23 | 24 | #ifndef __NOPOLL_CONFIG_H__ 25 | #define __NOPOLL_CONFIG_H__ 26 | 27 | /** 28 | * \addtogroup nopoll_decl_module 29 | * @{ 30 | */ 31 | 32 | /** 33 | * @brief Allows to convert integer value (including constant values) 34 | * into a pointer representation. 35 | * 36 | * Use the oposite function to restore the value from a pointer to a 37 | * integer: \ref PTR_TO_INT. 38 | * 39 | * @param integer The integer value to cast to pointer. 40 | * 41 | * @return A \ref noPollPtr reference. 42 | */ 43 | #ifndef INT_TO_PTR 44 | #define INT_TO_PTR(integer) ((noPollPtr) (integer)) 45 | #endif 46 | 47 | /** 48 | * @brief Allows to convert a pointer reference (\ref noPollPtr), 49 | * which stores an integer that was stored using \ref INT_TO_PTR. 50 | * 51 | * Use the oposite function to restore the pointer value stored in the 52 | * integer value. 53 | * 54 | * @param ptr The pointer to cast to a integer value. 55 | * 56 | * @return A int value. 57 | */ 58 | #ifndef PTR_TO_INT 59 | #define PTR_TO_INT(ptr) ((int) (ptr)) 60 | #endif 61 | 62 | /** 63 | * @brief Allows to get current platform configuration. This is used 64 | * by Nopoll library but could be used by applications built on top of 65 | * Nopoll to change its configuration based on the platform information. 66 | * 67 | * Note when this flag is enabled (set to 1), it means we are 68 | * compiling in a windows platform (no matter if it is 64 or 32 69 | * bits). To check for 64bit see NOPOLL_OS_WIN64. 70 | */ 71 | #define NOPOLL_OS_WIN32 (1) 72 | 73 | 74 | 75 | /* @} */ 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /nopoll-win/include/nopoll_ctx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | #ifndef __NOPOLL_CTX_H__ 40 | #define __NOPOLL_CTX_H__ 41 | 42 | #include 43 | 44 | BEGIN_C_DECLS 45 | 46 | noPollCtx * nopoll_ctx_new (void); 47 | 48 | nopoll_bool nopoll_ctx_ref (noPollCtx * ctx); 49 | 50 | void nopoll_ctx_unref (noPollCtx * ctx); 51 | 52 | int nopoll_ctx_ref_count (noPollCtx * ctx); 53 | 54 | nopoll_bool nopoll_ctx_register_conn (noPollCtx * ctx, 55 | noPollConn * conn); 56 | 57 | void nopoll_ctx_unregister_conn (noPollCtx * ctx, 58 | noPollConn * conn); 59 | 60 | int nopoll_ctx_conns (noPollCtx * ctx); 61 | 62 | nopoll_bool nopoll_ctx_set_certificate (noPollCtx * ctx, 63 | const char * serverName, 64 | const char * certificateFile, 65 | const char * privateKey, 66 | const char * optionalChainFile); 67 | 68 | nopoll_bool nopoll_ctx_find_certificate (noPollCtx * ctx, 69 | const char * serverName, 70 | const char ** certificateFile, 71 | const char ** privateKey, 72 | const char ** optionalChainFile); 73 | 74 | void nopoll_ctx_set_on_accept (noPollCtx * ctx, 75 | noPollActionHandler on_accept, 76 | noPollPtr user_data); 77 | 78 | void nopoll_ctx_set_on_open (noPollCtx * ctx, 79 | noPollActionHandler on_open, 80 | noPollPtr user_data); 81 | 82 | void nopoll_ctx_set_on_ready (noPollCtx * ctx, 83 | noPollActionHandler on_ready, 84 | noPollPtr user_data); 85 | 86 | void nopoll_ctx_set_on_msg (noPollCtx * ctx, 87 | noPollOnMessageHandler on_msg, 88 | noPollPtr user_data); 89 | 90 | noPollConn * nopoll_ctx_foreach_conn (noPollCtx * ctx, noPollForeachConn foreach, noPollPtr user_data); 91 | 92 | void nopoll_ctx_set_protocol_version (noPollCtx * ctx, int version); 93 | 94 | void nopoll_ctx_free (noPollCtx * ctx); 95 | 96 | END_C_DECLS 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /nopoll-win/include/nopoll_io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | #ifndef __NOPOLL_IO_H__ 40 | #define __NOPOLL_IO_H__ 41 | 42 | #include 43 | 44 | BEGIN_C_DECLS 45 | 46 | noPollIoEngine * nopoll_io_get_engine (noPollCtx * ctx, noPollIoEngineType engine_type); 47 | 48 | void nopoll_io_release_engine (noPollIoEngine * engine); 49 | 50 | END_C_DECLS 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /nopoll-win/include/nopoll_listener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | #ifndef __NOPOLL_LISTENER_H__ 40 | #define __NOPOLL_LISTENER_H__ 41 | 42 | #include 43 | 44 | BEGIN_C_DECLS 45 | 46 | NOPOLL_SOCKET nopoll_listener_sock_listen (noPollCtx * ctx, 47 | const char * host, 48 | const char * port); 49 | 50 | noPollConn * nopoll_listener_new (noPollCtx * ctx, 51 | const char * host, 52 | const char * port); 53 | 54 | noPollConn * nopoll_listener_new_opts (noPollCtx * ctx, 55 | noPollConnOpts * opts, 56 | const char * host, 57 | const char * port); 58 | 59 | noPollConn * nopoll_listener_tls_new (noPollCtx * ctx, 60 | const char * host, 61 | const char * port); 62 | 63 | noPollConn * nopoll_listener_tls_new_opts (noPollCtx * ctx, 64 | noPollConnOpts * opts, 65 | const char * host, 66 | const char * port); 67 | 68 | nopoll_bool nopoll_listener_set_certificate (noPollConn * listener, 69 | const char * certificate, 70 | const char * private_key, 71 | const char * chain_file); 72 | 73 | noPollConn * nopoll_listener_from_socket (noPollCtx * ctx, 74 | NOPOLL_SOCKET session); 75 | 76 | NOPOLL_SOCKET nopoll_listener_accept (NOPOLL_SOCKET server_socket); 77 | 78 | END_C_DECLS 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /nopoll-win/include/nopoll_loop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | #ifndef __NOPOLL_LOOP_H__ 40 | #define __NOPOLL_LOOP_H__ 41 | 42 | #include 43 | 44 | BEGIN_C_DECLS 45 | 46 | int nopoll_loop_wait (noPollCtx * ctx, long timeout); 47 | 48 | void nopoll_loop_stop (noPollCtx * ctx); 49 | 50 | END_C_DECLS 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /nopoll-win/include/nopoll_msg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | #ifndef __NOPOLL_MSG_H__ 40 | #define __NOPOLL_MSG_H__ 41 | 42 | #include 43 | 44 | BEGIN_C_DECLS 45 | 46 | const unsigned char * nopoll_msg_get_payload (noPollMsg * msg); 47 | 48 | int nopoll_msg_get_payload_size (noPollMsg * msg); 49 | 50 | noPollMsg * nopoll_msg_new (void); 51 | 52 | nopoll_bool nopoll_msg_ref (noPollMsg * msg); 53 | 54 | int nopoll_msg_ref_count (noPollMsg * msg); 55 | 56 | nopoll_bool nopoll_msg_is_final (noPollMsg * msg); 57 | 58 | nopoll_bool nopoll_msg_is_fragment (noPollMsg * msg); 59 | 60 | noPollOpCode nopoll_msg_opcode (noPollMsg * msg); 61 | 62 | noPollMsg * nopoll_msg_join (noPollMsg * msg, noPollMsg * msg2); 63 | 64 | void nopoll_msg_unref (noPollMsg * msg); 65 | 66 | END_C_DECLS 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /nopoll-win/include/nopoll_win32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | 40 | #ifndef __NOPOLL_WIN32_H__ 41 | #define __NOPOLL_WIN32_H__ 42 | 43 | #include 44 | 45 | BEGIN_C_DECLS 46 | 47 | int nopoll_win32_init (noPollCtx * ctx); 48 | 49 | int nopoll_win32_nonblocking_enable (NOPOLL_SOCKET socket); 50 | 51 | int nopoll_win32_blocking_enable (NOPOLL_SOCKET socket); 52 | 53 | /* gettimeofday support on windows */ 54 | int nopoll_win32_gettimeofday (struct timeval *tv, noPollPtr notUsed); 55 | 56 | BOOL APIENTRY DllMain (HINSTANCE hInst, 57 | DWORD reason, 58 | LPVOID reserved); 59 | 60 | #if !defined(EINPROGRESS) 61 | #define EINPROGRESS (WSAEINPROGRESS) 62 | #endif 63 | 64 | END_C_DECLS 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /nopoll-win/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/nopoll-win/libeay32.dll -------------------------------------------------------------------------------- /nopoll-win/libnopoll.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/nopoll-win/libnopoll.dll -------------------------------------------------------------------------------- /nopoll-win/libnopoll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/nopoll-win/libnopoll.lib -------------------------------------------------------------------------------- /nopoll-win/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/nopoll-win/ssleay32.dll -------------------------------------------------------------------------------- /nopoll/AUTHORS: -------------------------------------------------------------------------------- 1 | Francis Brosnan Blázquez 2 | -------------------------------------------------------------------------------- /nopoll/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/nopoll/ChangeLog -------------------------------------------------------------------------------- /nopoll/INSTALL: -------------------------------------------------------------------------------- 1 | See http://www.aspl.es/nopoll 2 | -------------------------------------------------------------------------------- /nopoll/Makefile.am: -------------------------------------------------------------------------------- 1 | if ENABLE_NOPOLL_DOC 2 | NOPOLL_DOC_DIR = doc 3 | endif 4 | 5 | SUBDIRS = src test $(NOPOLL_DOC_DIR) 6 | EXTRA_DIST = nopoll.pc.in VERSION Makefile.win 7 | pkgconfigdir = $(libdir)/pkgconfig 8 | pkgconfig_DATA = nopoll.pc 9 | 10 | all-local: update-defs 11 | 12 | update-defs: 13 | cd src; make update-def; cd .. 14 | 15 | -------------------------------------------------------------------------------- /nopoll/Makefile.win: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/nopoll/Makefile.win -------------------------------------------------------------------------------- /nopoll/NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/nopoll/NEWS -------------------------------------------------------------------------------- /nopoll/README: -------------------------------------------------------------------------------- 1 | --== Nopoll: a websocket toolkit ==-- 2 | 3 | --== Introduction ==-- 4 | 5 | See http://www.aspl.es/nopoll 6 | -------------------------------------------------------------------------------- /nopoll/TODO: -------------------------------------------------------------------------------- 1 | * Fix security issue about allocating more memory for the message at 2 | nopoll_conn.c:1453 (inside nopoll_conn_get_msg) 3 | 4 | * Add external mutex support to ensure the library is thread safe. 5 | - Add into nopoll_conn_sock_conect to protect gethostbyname 6 | 7 | * Check following headers: 8 | GET / HTTP/1.1\n 9 | GET / HTTP/1.1\n 10 | GET / HTTP/1.1\r\n 11 | GET /\n 12 | GET /\r\n 13 | 14 | * See what to do with concurrent connections being setup to a server 15 | at the same time: technically the standard states this is not possible. 16 | Section 5.1.2 17 | 18 | * Add support for Sec-Websocket-Extensions. 19 | 20 | * Add support for all Cookie support as defined here: 21 | http://tools.ietf.org/html/draft-ietf-httpstate-cookie-20 22 | 23 | -------------------------------------------------------------------------------- /nopoll/VERSION: -------------------------------------------------------------------------------- 1 | 0.2.6.b130 2 | -------------------------------------------------------------------------------- /nopoll/config.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated from config.h.in by configure. */ 2 | /* config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Define to 1 if you have the header file. */ 5 | #define HAVE_DLFCN_H 1 6 | 7 | /* Define to 1 if you have the header file. */ 8 | #define HAVE_INTTYPES_H 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #define HAVE_MEMORY_H 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_STDINT_H 1 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #define HAVE_STDLIB_H 1 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #define HAVE_STRINGS_H 1 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STRING_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #define HAVE_SYS_STAT_H 1 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_SYS_TYPES_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_UNISTD_H 1 33 | 34 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 35 | */ 36 | #define LT_OBJDIR ".libs/" 37 | 38 | /* Name of package */ 39 | #define PACKAGE "nopoll" 40 | 41 | /* Define to the address where bug reports for this package should be sent. */ 42 | #define PACKAGE_BUGREPORT "" 43 | 44 | /* Define to the full name of this package. */ 45 | #define PACKAGE_NAME "" 46 | 47 | /* Define to the full name and version of this package. */ 48 | #define PACKAGE_STRING "" 49 | 50 | /* Define to the one symbol short name of this package. */ 51 | #define PACKAGE_TARNAME "" 52 | 53 | /* Define to the home page for this package. */ 54 | #define PACKAGE_URL "" 55 | 56 | /* Define to the version of this package. */ 57 | #define PACKAGE_VERSION "" 58 | 59 | /* The size of `int', as computed by sizeof. */ 60 | #define SIZEOF_INT 4 61 | 62 | /* The size of `long', as computed by sizeof. */ 63 | #define SIZEOF_LONG 4 64 | 65 | /* The size of `void *', as computed by sizeof. */ 66 | #define SIZEOF_VOID_P 4 67 | 68 | /* Define to 1 if you have the ANSI C header files. */ 69 | #define STDC_HEADERS 1 70 | 71 | /* Version number of package */ 72 | #define VERSION "0.2.6.b130" 73 | -------------------------------------------------------------------------------- /nopoll/config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_MEMORY_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_STDINT_H 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_STDLIB_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STRINGS_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STRING_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_SYS_STAT_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_SYS_TYPES_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_UNISTD_H 32 | 33 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 34 | */ 35 | #undef LT_OBJDIR 36 | 37 | /* Name of package */ 38 | #undef PACKAGE 39 | 40 | /* Define to the address where bug reports for this package should be sent. */ 41 | #undef PACKAGE_BUGREPORT 42 | 43 | /* Define to the full name of this package. */ 44 | #undef PACKAGE_NAME 45 | 46 | /* Define to the full name and version of this package. */ 47 | #undef PACKAGE_STRING 48 | 49 | /* Define to the one symbol short name of this package. */ 50 | #undef PACKAGE_TARNAME 51 | 52 | /* Define to the home page for this package. */ 53 | #undef PACKAGE_URL 54 | 55 | /* Define to the version of this package. */ 56 | #undef PACKAGE_VERSION 57 | 58 | /* The size of `int', as computed by sizeof. */ 59 | #undef SIZEOF_INT 60 | 61 | /* The size of `long', as computed by sizeof. */ 62 | #undef SIZEOF_LONG 63 | 64 | /* The size of `void *', as computed by sizeof. */ 65 | #undef SIZEOF_VOID_P 66 | 67 | /* Define to 1 if you have the ANSI C header files. */ 68 | #undef STDC_HEADERS 69 | 70 | /* Version number of package */ 71 | #undef VERSION 72 | -------------------------------------------------------------------------------- /nopoll/doc/Makefile.am: -------------------------------------------------------------------------------- 1 | # still nothing 2 | EXTRA_DIST = nopoll.doxygen \ 3 | nopoll-doc-footer.html \ 4 | nopoll-doc-header.html \ 5 | main-page-logo.png \ 6 | aspl-logo-header.png \ 7 | nopoll.css \ 8 | body_back.gif 9 | 10 | bin_SCRIPTS = initial_build_doc 11 | 12 | help: 13 | @echo 14 | @echo " Documentation not build!:" 15 | @echo " ~~~~~~~~~~~~~~~~~~~~~~~~~" 16 | @echo " --> Doxygen documentation wasn't built because an stamp was detected: doc.stamp" 17 | @echo " --> To regenerate or force doc building type make build_doc or remove doc.stamp"; 18 | @echo 19 | 20 | initial_build_doc: 21 | @echo "checking documenation stamp.."; 22 | @test -e doc.stamp & make help 23 | @test -e doc.stamp || make build_doc 24 | @test -e doc.stamp || touch doc.stamp 25 | 26 | build_doc: 27 | rm -rf html/ 28 | @echo "Generating module documentation.."; 29 | doxygen nopoll.doxygen 30 | cp $(top_srcdir)/doc/main-page-logo.png html 31 | cp $(top_srcdir)/doc/aspl-logo-header.png html 32 | cp $(top_srcdir)/doc/nopoll.css html 33 | cp $(top_srcdir)/doc/body_back.gif html 34 | -------------------------------------------------------------------------------- /nopoll/doc/aspl-logo-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/nopoll/doc/aspl-logo-header.png -------------------------------------------------------------------------------- /nopoll/doc/body_back.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/nopoll/doc/body_back.gif -------------------------------------------------------------------------------- /nopoll/doc/main-page-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifki/dfremote/c3ba68498db0f3fdba7e7f3695ec804e928f52ae/nopoll/doc/main-page-logo.png -------------------------------------------------------------------------------- /nopoll/doc/nopoll-doc-footer.html: -------------------------------------------------------------------------------- 1 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /nopoll/doc/nopoll-doc-header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | noPoll websocket implementation , WebSocket implementation, RFC 6455 implementation, (Servidores Linux http://www.aspl.es) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 22 | 23 | -------------------------------------------------------------------------------- /nopoll/doc/nopoll.css: -------------------------------------------------------------------------------- 1 | /* strong aspl blue: #00568d; */ 2 | /* soft grey used as separator: #c9c9c9; */ 3 | /* soft yellow for the function panel: #fffddf; */ 4 | /* strong grey for some backgrounds: #b0b0b0; */ 5 | 6 | body { 7 | } 8 | 9 | h1, h2, h3, a { 10 | color: #172e4b; 11 | } 12 | 13 | p, b, ul, li, i { 14 | } 15 | 16 | a:visited { 17 | color: #1066be; 18 | } 19 | 20 | .af-arch-header { 21 | width: 100%; 22 | background: #193141; 23 | margin: 0; 24 | } 25 | 26 | .separator { 27 | border: 2px solid #c9c9c9; 28 | background: #7d0000; 29 | height: 10px; 30 | } 31 | 32 | .footer { 33 | padding: 4px; 34 | clear: left; 35 | background: #193141; 36 | color: white; 37 | font-weight: bold; 38 | } 39 | 40 | .thepage { 41 | background: white; 42 | border-right: 1px solid #193141; 43 | width: 80%; 44 | padding: 5px; 45 | padding-left: 15px; 46 | } 47 | 48 | .onepage { 49 | width: 70%; 50 | text-align: justify; 51 | } 52 | 53 | .license-table { 54 | border: 1px solid #000000; 55 | padding: 0; 56 | margin: 12px; 57 | margin-left: 24px; 58 | background-color: #c9c9c9; 59 | } 60 | 61 | 62 | .license-table tr { 63 | margin: 0; 64 | padding: 0; 65 | } 66 | 67 | .licence-table tr.impar { 68 | border: 0; 69 | } 70 | 71 | .license-table tr.par { 72 | border: 0; 73 | background-color: #fffddf; 74 | } 75 | 76 | .license-table td { 77 | padding: 6; 78 | border: 0; 79 | } 80 | 81 | .nobullet { 82 | list-style: none; 83 | } 84 | 85 | .syntax { 86 | margin-left: 28px; 87 | margin-right: 28px; 88 | font-size: 100%; 89 | font-family: Monospace,Fixed; 90 | border: 1px solid #07445e; 91 | background-color: #bed7e2; 92 | } 93 | 94 | .initial-index li { 95 | padding-bottom: 3px; 96 | } 97 | 98 | .contact { 99 | margin-left: 40px; 100 | border: 2px solid #00366d; 101 | background-color: #84afdc; 102 | font-size: 110%; 103 | font-family: Sans,Arial,Helvetica; 104 | } 105 | .contact tr { 106 | border: 0px; 107 | } 108 | .contact td { 109 | border: 0px; 110 | } 111 | 112 | div.navtab { 113 | background: #ffffd8; 114 | border: 1px solid #b0b0b0; 115 | } 116 | 117 | div.navtab .qindexHL { 118 | background: #193141; 119 | color: white; 120 | } 121 | 122 | div.navtab a:hover { 123 | background: #b0b0b0; 124 | color: white; 125 | } 126 | 127 | h2 a.anchor { 128 | padding: 2px; 129 | background: #fff url("body_back.gif") repeat-x; 130 | border: 1px solid #b0b0b0; 131 | } 132 | 133 | pre.fragment { 134 | font-family: Monospace,Fixed,Courier; 135 | font-size: 90%; 136 | } 137 | 138 | .mdRow { 139 | font-family: Monospace,Fixed,Courier; 140 | font-size: 90%; 141 | } 142 | 143 | .mdTable .mdRow table td { 144 | width: 10px; 145 | } 146 | 147 | .aspl-logo-header { 148 | padding: 0px; 149 | margin: 0px; 150 | padding-top: 6px; 151 | padding-right: 10px; 152 | position: absolute; 153 | top: 0px; 154 | right: 0px; 155 | float: right; 156 | border: 0px; 157 | } 158 | 159 | .ads { 160 | width: 100%; 161 | height: 112px; 162 | border-top: 1px solid #193141; 163 | border-bottom: 1px solid #193141; 164 | background: #c9c9c9; 165 | } 166 | 167 | .ads iframe { 168 | width: 802px; 169 | height: 102px; 170 | position: absolute; 171 | top: 90px; 172 | left: 200px; 173 | background: #c9c9c9 url("bg.png"); 174 | } 175 | 176 | .lateral-ad { 177 | position: absolute; 178 | left: 84%; 179 | top: 30%; 180 | background: #c9c9c9; 181 | z-index: -1; 182 | } 183 | 184 | .lateral-ad iframe { 185 | width: 152px; 186 | height: 420px; 187 | background: #c9c9c9; 188 | } -------------------------------------------------------------------------------- /nopoll/nopoll.pc: -------------------------------------------------------------------------------- 1 | prefix=/usr/local 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: libNoPoll 7 | Description: LibNoPoll: websocket toolkit library 8 | Version: 0.2.6.b130 9 | Libs: -L${libdir} -lnopoll 10 | Cflags: -I${includedir}/nopoll 11 | -------------------------------------------------------------------------------- /nopoll/nopoll.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libNoPoll 7 | Description: LibNoPoll: websocket toolkit library 8 | Version: @NOPOLL_VERSION@ 9 | Libs: -L${libdir} -lnopoll 10 | Cflags: -I${includedir}/nopoll 11 | -------------------------------------------------------------------------------- /nopoll/src/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = libnopoll.def Makefile.win 2 | 3 | if ENABLE_NOPOLL_LOG 4 | LOG = -DSHOW_DEBUG_LOG 5 | endif 6 | 7 | INCLUDES = $(compiler_options) -I$(top_srcdir) $(LIBRARIES_CFLAGS) -DVERSION=\""$(NOPOLL_VERSION)"\" \ 8 | -DPACKAGE_DTD_DIR=\""$(datadir)"\" -DPACKAGE_TOP_DIR=\""$(top_srcdir)"\" \ 9 | -DVERSION=\"$(NOPOLL_VERSION)\" $(LOG) 10 | 11 | libnopollincludedir = $(includedir)/nopoll 12 | 13 | lib_LTLIBRARIES = libnopoll.la 14 | 15 | libnopoll_la_SOURCES = \ 16 | nopoll.c \ 17 | nopoll_decl.c \ 18 | nopoll_ctx.c \ 19 | nopoll_conn.c \ 20 | nopoll_log.c \ 21 | nopoll_listener.c \ 22 | nopoll_loop.c \ 23 | nopoll_io.c \ 24 | nopoll_msg.c \ 25 | nopoll_win32.c 26 | 27 | libnopollinclude_HEADERS = \ 28 | nopoll.h \ 29 | nopoll_handlers.h \ 30 | nopoll_config.h \ 31 | nopoll_decl.h \ 32 | nopoll_private.h \ 33 | nopoll_ctx.h \ 34 | nopoll_conn.h \ 35 | nopoll_log.h \ 36 | nopoll_listener.h \ 37 | nopoll_loop.h \ 38 | nopoll_io.h \ 39 | nopoll_msg.h \ 40 | nopoll_win32.h 41 | 42 | libnopoll_la_LDFLAGS = -no-undefined -export-symbols-regex '^(nopoll|__nopoll|_nopoll).*' 43 | 44 | libnopoll_la_LIBADD = $(TLS_LIBS) 45 | 46 | libnopoll.def: update-def 47 | 48 | update-def: 49 | echo "EXPORTS" > libnopoll.def 50 | cat .libs/libnopoll.exp >> libnopoll.def 51 | 52 | -------------------------------------------------------------------------------- /nopoll/src/Makefile.win: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- Makefile for windows (mingw) 2 | OBJ = nopoll.o \ 3 | nopoll_decl.o \ 4 | nopoll_win32.o \ 5 | nopoll_ctx.o \ 6 | nopoll_conn.o \ 7 | nopoll_log.o \ 8 | nopoll_listener.o \ 9 | nopoll_loop.o \ 10 | nopoll_io.o \ 11 | nopoll_msg.o 12 | 13 | ifdef enable_nopoll_log 14 | DLL = libnopoll-debug 15 | MODE = console 16 | else 17 | DLL = libnopoll 18 | MODE = windows 19 | endif 20 | IMPORT_DLL = $(DLL).dll.a 21 | STATIC_LIB = $(DLL).a 22 | 23 | #LIBS = -Wall $(enable_gcc_debug) -L"$(BASE_DIR)/lib" \ 24 | # -L"$(BASE_DIR)/bin" \ 25 | # --add-stdcall-alias \ 26 | # -lws2_32 \ 27 | # -lintl -liconv -lm 28 | LIBS = -Wall $(enable_gcc_debug) -lws2_32 $(OPENSSL_LIBS) $(search_lib_path) 29 | 30 | #INCS = -I"$(BASE_DIR)/include" \ 31 | 32 | # build vortex with log support 33 | INCS = -Wall $(enable_gcc_debug) -I"." -I"../src" $(enable_nopoll_log) $(show_debug) 34 | 35 | CFLAGS = $(INCS) -DVERSION=\""$(NOPOLL_VERSION)"\" \ 36 | -DPACKAGE_DTD_DIR=\""$(datadir)"\" -DPACKAGE_TOP_DIR=\""$(top_srcdir)"\" -Wall $(enable_gcc_debug) $(OPENSSL_FLAGS) 37 | RM = rm -f 38 | 39 | .PHONY: all clean 40 | 41 | all: $(DLL).dll 42 | 43 | clean: 44 | ${RM} $(OBJ) $(DLL).dll 45 | ${RM} *.a *.dll.a *.lib *.dll 46 | 47 | $(DLL).dll: $(OBJ) 48 | # add the following line to create an import library. At this point this step 49 | # is not requiered because gcc automatically get an import library from the dll. 50 | # -Wl,--out-implib,libvortex-1.1.lib 51 | @echo "Creating library.." 52 | $(CC) -m$(MODE) -shared -Wl,--out-implib,$(IMPORT_DLL) $(export_all_symbols) $(OBJ) -o $(DLL).dll $(LIBS) 53 | @echo "Building libnopoll.lib file.." 54 | lib.exe /def:libnopoll.def 55 | cp $(DLL).dll $(release_dir) 56 | cp libnopoll.exp $(release_dir)/$(DLL).exp 57 | cp libnopoll.lib $(release_dir)/$(DLL).lib 58 | cp $(IMPORT_DLL) $(release_dir) 59 | 60 | %.o: %.c 61 | $(CC) -c $< -o $@ $(CFLAGS) 62 | -------------------------------------------------------------------------------- /nopoll/src/nopoll_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Nopoll Library nopoll_config.h 3 | * Platform dependant definitions. 4 | * 5 | * This is a generated file. Please modify 'configure.in' 6 | */ 7 | 8 | #ifndef __NOPOLL_CONFIG_H__ 9 | #define __NOPOLL_CONFIG_H__ 10 | 11 | /** 12 | * \addtogroup nopoll_decl_module 13 | * @{ 14 | */ 15 | 16 | /** 17 | * @brief Allows to convert integer value (including constant values) 18 | * into a pointer representation. 19 | * 20 | * Use the oposite function to restore the value from a pointer to a 21 | * integer: \ref PTR_TO_INT. 22 | * 23 | * @param integer The integer value to cast to pointer. 24 | * 25 | * @return A \ref noPollPtr reference. 26 | */ 27 | #ifndef INT_TO_PTR 28 | #define INT_TO_PTR(integer) ((noPollPtr) ((int)integer)) 29 | #endif 30 | 31 | /** 32 | * @brief Allows to convert a pointer reference (\ref noPollPtr), 33 | * which stores an integer that was stored using \ref INT_TO_PTR. 34 | * 35 | * Use the oposite function to restore the pointer value stored in the 36 | * integer value. 37 | * 38 | * @param ptr The pointer to cast to a integer value. 39 | * 40 | * @return A int value. 41 | */ 42 | #ifndef PTR_TO_INT 43 | #define PTR_TO_INT(ptr) ((int) (ptr)) 44 | #endif 45 | 46 | /** 47 | * @brief Allows to get current platform configuration. This is used 48 | * by Nopoll library but could be used by applications built on top of 49 | * Nopoll to change its configuration based on the platform information. 50 | */ 51 | #define NOPOLL_OS_UNIX (1) 52 | 53 | /** 54 | * @internal Allows to now if the platform support vasprintf 55 | * function. Do not use this macro as it is supposed to be for 56 | * internal use. 57 | */ 58 | #define NOPOLL_HAVE_VASPRINTF (1) 59 | 60 | 61 | 62 | /* @} */ 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /nopoll/src/nopoll_ctx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | #ifndef __NOPOLL_CTX_H__ 40 | #define __NOPOLL_CTX_H__ 41 | 42 | #include 43 | 44 | noPollCtx * nopoll_ctx_new (void); 45 | 46 | nopoll_bool nopoll_ctx_ref (noPollCtx * ctx); 47 | 48 | void nopoll_ctx_unref (noPollCtx * ctx); 49 | 50 | int nopoll_ctx_ref_count (noPollCtx * ctx); 51 | 52 | nopoll_bool nopoll_ctx_register_conn (noPollCtx * ctx, 53 | noPollConn * conn); 54 | 55 | void nopoll_ctx_unregister_conn (noPollCtx * ctx, 56 | noPollConn * conn); 57 | 58 | int nopoll_ctx_conns (noPollCtx * ctx); 59 | 60 | nopoll_bool nopoll_ctx_set_certificate (noPollCtx * ctx, 61 | const char * serverName, 62 | const char * certificateFile, 63 | const char * privateKey, 64 | const char * optionalChainFile); 65 | 66 | nopoll_bool nopoll_ctx_find_certificate (noPollCtx * ctx, 67 | const char * serverName, 68 | const char ** certificateFile, 69 | const char ** privateKey, 70 | const char ** optionalChainFile); 71 | 72 | void nopoll_ctx_set_on_open (noPollCtx * ctx, 73 | noPollActionHandler on_open, 74 | noPollPtr user_data); 75 | 76 | void nopoll_ctx_set_on_accept (noPollCtx * ctx, 77 | noPollActionHandler on_accept, 78 | noPollPtr user_data); 79 | 80 | void nopoll_ctx_set_on_msg (noPollCtx * ctx, 81 | noPollOnMessageHandler on_msg, 82 | noPollPtr user_data); 83 | 84 | noPollConn * nopoll_ctx_foreach_conn (noPollCtx * ctx, noPollForeachConn foreach, noPollPtr user_data); 85 | 86 | void nopoll_ctx_set_protocol_version (noPollCtx * ctx, int version); 87 | 88 | void nopoll_ctx_free (noPollCtx * ctx); 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /nopoll/src/nopoll_decl.c: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | #include 40 | 41 | /** 42 | * \addtogroup nopoll_decl_module 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @brief Calloc helper for nopoll library. 48 | * 49 | * @param count How many items to allocate. 50 | * @param size Size of one item. 51 | * 52 | * @return A newly allocated pointer. 53 | * @see nopoll_free 54 | */ 55 | noPollPtr nopoll_calloc(size_t count, size_t size) 56 | { 57 | return calloc (count, size); 58 | } 59 | 60 | /** 61 | * @brief Realloc helper for nopoll library. 62 | * 63 | * @param ref the reference to reallocate. 64 | * @param size Size of the new reference. 65 | * 66 | * @return A newly allocated pointer. 67 | * @see nopoll_free 68 | */ 69 | noPollPtr nopoll_realloc(noPollPtr ref, size_t size) 70 | { 71 | return realloc (ref, size); 72 | } 73 | 74 | /** 75 | * @brief Allows to deallocate memory referenced by ref but 76 | * checking before that the reference is different from null. 77 | * 78 | * @param ref The reference to clear. 79 | */ 80 | void nopoll_free (noPollPtr ref) 81 | { 82 | free (ref); 83 | return; 84 | } 85 | 86 | 87 | /** 88 | * @} 89 | */ 90 | 91 | -------------------------------------------------------------------------------- /nopoll/src/nopoll_io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | #ifndef __NOPOLL_IO_H__ 40 | #define __NOPOLL_IO_H__ 41 | 42 | #include 43 | 44 | noPollIoEngine * nopoll_io_get_engine (noPollCtx * ctx, noPollIoEngineType engine_type); 45 | 46 | void nopoll_io_release_engine (noPollIoEngine * engine); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /nopoll/src/nopoll_listener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | #ifndef __NOPOLL_LISTENER_H__ 40 | #define __NOPOLL_LISTENER_H__ 41 | 42 | #include 43 | 44 | NOPOLL_SOCKET nopoll_listener_sock_listen (noPollCtx * ctx, 45 | const char * host, 46 | const char * port); 47 | 48 | noPollConn * nopoll_listener_new (noPollCtx * ctx, 49 | const char * host, 50 | const char * port); 51 | 52 | noPollConn * nopoll_listener_tls_new (noPollCtx * ctx, 53 | const char * host, 54 | const char * port); 55 | 56 | nopoll_bool nopoll_listener_set_certificate (noPollConn * listener, 57 | const char * certificate, 58 | const char * private_key, 59 | const char * chain_file); 60 | 61 | noPollConn * nopoll_listener_from_socket (noPollCtx * ctx, 62 | NOPOLL_SOCKET session); 63 | 64 | NOPOLL_SOCKET nopoll_listener_accept (NOPOLL_SOCKET server_socket); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /nopoll/src/nopoll_loop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | #ifndef __NOPOLL_LOOP_H__ 40 | #define __NOPOLL_LOOP_H__ 41 | 42 | #include 43 | 44 | int nopoll_loop_wait (noPollCtx * ctx, long timeout); 45 | 46 | void nopoll_loop_stop (noPollCtx * ctx); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /nopoll/src/nopoll_msg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | #ifndef __NOPOLL_MSG_H__ 40 | #define __NOPOLL_MSG_H__ 41 | 42 | #include 43 | 44 | const noPollPtr nopoll_msg_get_payload (noPollMsg * msg); 45 | 46 | int nopoll_msg_get_payload_size (noPollMsg * msg); 47 | 48 | noPollMsg * nopoll_msg_new (void); 49 | 50 | nopoll_bool nopoll_msg_ref (noPollMsg * msg); 51 | 52 | int nopoll_msg_ref_count (noPollMsg * msg); 53 | 54 | nopoll_bool nopoll_msg_is_final (noPollMsg * msg); 55 | 56 | nopoll_bool nopoll_msg_is_fragment (noPollMsg * msg); 57 | 58 | noPollOpCode nopoll_msg_opcode (noPollMsg * msg); 59 | 60 | noPollMsg * nopoll_msg_join (noPollMsg * msg, noPollMsg * msg2); 61 | 62 | void nopoll_msg_unref (noPollMsg * msg); 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /nopoll/src/nopoll_win32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LibNoPoll: A websocket library 3 | * Copyright (C) 2013 Advanced Software Production Line, S.L. 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this program; if not, write to the Free 17 | * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 18 | * 02111-1307 USA 19 | * 20 | * You may find a copy of the license under this software is released 21 | * at COPYING file. This is LGPL software: you are welcome to develop 22 | * proprietary applications using this library without any royalty or 23 | * fee but returning back any change, improvement or addition in the 24 | * form of source code, project image, documentation patches, etc. 25 | * 26 | * For commercial support on build Websocket enabled solutions 27 | * contact us: 28 | * 29 | * Postal address: 30 | * Advanced Software Production Line, S.L. 31 | * Edificio Alius A, Oficina 102, 32 | * C/ Antonio Suarez Nº 10, 33 | * Alcalá de Henares 28802 Madrid 34 | * Spain 35 | * 36 | * Email address: 37 | * info@aspl.es - http://www.aspl.es/nopoll 38 | */ 39 | 40 | #ifndef __NOPOLL_WIN32_H__ 41 | #define __NOPOLL_WIN32_H__ 42 | 43 | #include 44 | 45 | BEGIN_C_DECLS 46 | 47 | int nopoll_win32_init (noPollCtx * ctx); 48 | 49 | int nopoll_win32_nonblocking_enable (NOPOLL_SOCKET socket); 50 | 51 | int nopoll_win32_blocking_enable (NOPOLL_SOCKET socket); 52 | 53 | /* gettimeofday support on windows */ 54 | int nopoll_win32_gettimeofday (struct timeval *tv, noPollPtr notUsed); 55 | 56 | BOOL APIENTRY DllMain (HINSTANCE hInst, 57 | DWORD reason, 58 | LPVOID reserved); 59 | 60 | #if !defined(EINPROGRESS) 61 | #define EINPROGRESS (WSAEINPROGRESS) 62 | #endif 63 | 64 | END_C_DECLS 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /nopoll/stamp-h1: -------------------------------------------------------------------------------- 1 | timestamp for config.h 2 | -------------------------------------------------------------------------------- /nopoll/test/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = Makefile.win test-certificate.crt test-private.key 2 | 3 | # still nothing 4 | if ENABLE_NOPOLL_LOG 5 | LOG = -DSHOW_DEBUG_LOG 6 | endif 7 | 8 | INCLUDES = -DTEST_DIR=$(top_srcdir)/test -I$(top_srcdir)/src/ $(compiler_options) $(LOG) -DVERSION=\""$(NOPOLL_VERSION)"\" 9 | 10 | # replace with bin_PROGRAMS to check performance 11 | noinst_PROGRAMS = nopoll-regression-client nopoll-regression-listener 12 | TESTS = nopoll-regression-client nopoll-regression-listener 13 | 14 | nopoll_regression_client_SOURCES = nopoll-regression-client.c 15 | nopoll_regression_client_LDADD = $(top_builddir)/src/libnopoll.la 16 | 17 | nopoll_regression_listener_SOURCES = nopoll-regression-listener.c 18 | nopoll_regression_listener_LDADD = $(top_builddir)/src/libnopoll.la 19 | 20 | leak-check: 21 | libtool --mode=execute valgrind --leak-check=yes ./test_01 22 | 23 | -------------------------------------------------------------------------------- /nopoll/test/Makefile.win: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | ifdef enable_nopoll_log 3 | nopoll_dll = -lnopoll-debug 4 | DLL = libnopoll-debug.dll 5 | else 6 | nopoll_dll = -lnopoll 7 | DLL = libnopoll.dll 8 | endif 9 | 10 | CC = gcc.exe -g -Wall -Werror 11 | OBJ = nopoll-regression-client.o \ 12 | nopoll-regression-client.o 13 | 14 | PROGRAMS = nopoll-regression-client.exe \ 15 | nopoll-regression-listener.exe 16 | 17 | LIBS = -Wall -Werror -g -lws2_32 $(AXL_LIBS) $(search_lib_path) -L../src $(nopoll_dll) ../src/$(DLL) 18 | 19 | INCS = -I"." -I"../src" -DENABLE_TLS_SUPPORT $(show_debug) 20 | 21 | CFLAGS = $(INCS) -DVERSION=\""$(NOPOLL_VERSION)"\" -Wall -g 22 | 23 | .PHONY: all all-before all-after clean clean-custom 24 | 25 | all: $(PROGRAMS) all-after links 26 | 27 | clean: clean-custom 28 | ${RM} $(OBJ) $(PROGRAMS) *.dll *.o 29 | 30 | client_depends = nopoll-regression-client.o 31 | nopoll-regression-client.exe: $(client_depends) 32 | $(CC) -mconsole $(client_depends) -o $@ $(LIBS) 33 | 34 | listener_depends = nopoll-regression-listener.o 35 | nopoll-regression-listener.exe: $(listener_depends) 36 | $(CC) -mconsole $(listener_depends) -o $@ $(LIBS) 37 | 38 | 39 | links: 40 | cp ../src/$(DLL) . 41 | cp $(OPENSSL_LIBS) . 42 | 43 | %.o: %.c 44 | $(CC) -c $< -o $@ $(CFLAGS) 45 | 46 | -------------------------------------------------------------------------------- /nopoll/test/test-certificate.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIID4DCCA0mgAwIBAgIJAN+fokFBG4UhMA0GCSqGSIb3DQEBBQUAMIGnMQswCQYD 3 | VQQGEwJFUzEPMA0GA1UECBMGTWFkcmlkMRswGQYDVQQHFBJBbGNhbMOhIGRlIEhl 4 | bmFyZXMxNzA1BgNVBAoTLkFTUEwgKEFkdmFuY2VkIFNvZnR3YXJlIFByb2R1Y3Rp 5 | b24gTGluZSwgUy5MLikxEzARBgNVBAsTClRJIFN1cHBvcnQxHDAaBgNVBAMTE3Rl 6 | c3Qubm9wb2xsLmFzcGwuZXMwHhcNMTMwMzAzMDkxOTU2WhcNMjMwMzAxMDkxOTU2 7 | WjCBpzELMAkGA1UEBhMCRVMxDzANBgNVBAgTBk1hZHJpZDEbMBkGA1UEBxQSQWxj 8 | YWzDoSBkZSBIZW5hcmVzMTcwNQYDVQQKEy5BU1BMIChBZHZhbmNlZCBTb2Z0d2Fy 9 | ZSBQcm9kdWN0aW9uIExpbmUsIFMuTC4pMRMwEQYDVQQLEwpUSSBTdXBwb3J0MRww 10 | GgYDVQQDExN0ZXN0Lm5vcG9sbC5hc3BsLmVzMIGfMA0GCSqGSIb3DQEBAQUAA4GN 11 | ADCBiQKBgQC4GcLeRL4busZZ5IqJQunH5wxYgVHEIgt499HBJ78BYv5Wi0lVvD4x 12 | /fUlvGsvsID0WQGzsgim03KUInDA30vFqBhsz2Eooi0aO0evOrVQmnK1RCL6EQzv 13 | L+EVYIBWk4FVWlxYxsFMyf7rLSz8wrJThDFcyNeq1lIBFlOzGNnHwQIDAQABo4IB 14 | EDCCAQwwHQYDVR0OBBYEFE/5BX/ShOWk6EbFgbcf4XQGpSJBMIHcBgNVHSMEgdQw 15 | gdGAFE/5BX/ShOWk6EbFgbcf4XQGpSJBoYGtpIGqMIGnMQswCQYDVQQGEwJFUzEP 16 | MA0GA1UECBMGTWFkcmlkMRswGQYDVQQHFBJBbGNhbMOhIGRlIEhlbmFyZXMxNzA1 17 | BgNVBAoTLkFTUEwgKEFkdmFuY2VkIFNvZnR3YXJlIFByb2R1Y3Rpb24gTGluZSwg 18 | Uy5MLikxEzARBgNVBAsTClRJIFN1cHBvcnQxHDAaBgNVBAMTE3Rlc3Qubm9wb2xs 19 | LmFzcGwuZXOCCQDfn6JBQRuFITAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA 20 | A4GBAKucVMTXYsW8x06XxTNXFbsLYGMc/UIMx5w4DbYIOXJz3yvIdJ8Alzg2O7DR 21 | XDzDJUE+WHlq7ZafVIFIWyY+eB5lINAMMTiwrVoqoyTT1X3vNd3W7Y0/v5afXxQ1 22 | UvTcOPeIkxs3Iee51BkjU98k7FwNBccPuVSyMKhdbIolC7Zb 23 | -----END CERTIFICATE----- 24 | -------------------------------------------------------------------------------- /nopoll/test/test-private.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXAIBAAKBgQC4GcLeRL4busZZ5IqJQunH5wxYgVHEIgt499HBJ78BYv5Wi0lV 3 | vD4x/fUlvGsvsID0WQGzsgim03KUInDA30vFqBhsz2Eooi0aO0evOrVQmnK1RCL6 4 | EQzvL+EVYIBWk4FVWlxYxsFMyf7rLSz8wrJThDFcyNeq1lIBFlOzGNnHwQIDAQAB 5 | AoGAIGUIESxvd1mqRW8doYGQuYhCd+BpjuWety6ETkS8K3ZL4tanlNqG5y0U0gsR 6 | oVahml1/Gyucsh5K7x4QUR/5qQWqN+da9zndO2ssH0Viyu6vxvPeMEbPe74qMsT4 7 | eO+slkpJVFZzpYP8sPsoBlJ5nZHtpD47UjfZBKXXbEyNY/ECQQDjq1yIMIb/W8YJ 8 | 7rwiEYHUdMD9YeTHjkDZWVfuwwdoM4ut7O0UXuScME/XY3PbAjpDO/utTL/cKhSJ 9 | pIlXH7fzAkEAzwJ5HJfBaBz0dhYIG4Y7P/AnhRBgCA6m7mrzAci4vqwLw1poD573 10 | gSNMCxZPk2vm6pO+b3cEeu18KJvvgcGCewJAQcyb8Kx9x73Bbct2yi3fJQUdZd3u 11 | HhKqAWdF97acJGyJWRoZpwKJ9e4slSakLE7ngdkLMxn0dXAgAWvxWaHMKwJAWMPQ 12 | twgDsOcplDEiTNskMOiDqbU52Hqf7gACL7OoNGqFqMDtejVKIB/IjcCFYsuT+uZb 13 | dGRukV+gK7Gh49vcXQJBAJdCc9PAaj1w729vMl+uXZX7luHOa5/rxMcNsjUR25q9 14 | BnByCR1YUnSr2H6PEfX0qxA8jt38BgZj0zb90Kt2p64= 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /sha256.h: -------------------------------------------------------------------------------- 1 | #ifndef SHA256_H 2 | #define SHA256_H 3 | #include 4 | 5 | class SHA256 6 | { 7 | protected: 8 | typedef unsigned char uint8; 9 | typedef unsigned int uint32; 10 | typedef unsigned long long uint64; 11 | 12 | const static uint32 sha256_k[]; 13 | static const unsigned int SHA224_256_BLOCK_SIZE = (512/8); 14 | public: 15 | void init(); 16 | void update(const unsigned char *message, unsigned int len); 17 | void final(unsigned char *digest); 18 | static const unsigned int DIGEST_SIZE = ( 256 / 8); 19 | 20 | protected: 21 | void transform(const unsigned char *message, unsigned int block_nb); 22 | unsigned int m_tot_len; 23 | unsigned int m_len; 24 | unsigned char m_block[2*SHA224_256_BLOCK_SIZE]; 25 | uint32 m_h[8]; 26 | }; 27 | 28 | std::string sha256(std::string input); 29 | 30 | #define SHA2_SHFR(x, n) (x >> n) 31 | #define SHA2_ROTR(x, n) ((x >> n) | (x << ((sizeof(x) << 3) - n))) 32 | #define SHA2_ROTL(x, n) ((x << n) | (x >> ((sizeof(x) << 3) - n))) 33 | #define SHA2_CH(x, y, z) ((x & y) ^ (~x & z)) 34 | #define SHA2_MAJ(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) 35 | #define SHA256_F1(x) (SHA2_ROTR(x, 2) ^ SHA2_ROTR(x, 13) ^ SHA2_ROTR(x, 22)) 36 | #define SHA256_F2(x) (SHA2_ROTR(x, 6) ^ SHA2_ROTR(x, 11) ^ SHA2_ROTR(x, 25)) 37 | #define SHA256_F3(x) (SHA2_ROTR(x, 7) ^ SHA2_ROTR(x, 18) ^ SHA2_SHFR(x, 3)) 38 | #define SHA256_F4(x) (SHA2_ROTR(x, 17) ^ SHA2_ROTR(x, 19) ^ SHA2_SHFR(x, 10)) 39 | #define SHA2_UNPACK32(x, str) \ 40 | { \ 41 | *((str) + 3) = (uint8) ((x) ); \ 42 | *((str) + 2) = (uint8) ((x) >> 8); \ 43 | *((str) + 1) = (uint8) ((x) >> 16); \ 44 | *((str) + 0) = (uint8) ((x) >> 24); \ 45 | } 46 | #define SHA2_PACK32(str, x) \ 47 | { \ 48 | *(x) = ((uint32) *((str) + 3) ) \ 49 | | ((uint32) *((str) + 2) << 8) \ 50 | | ((uint32) *((str) + 1) << 16) \ 51 | | ((uint32) *((str) + 0) << 24); \ 52 | } 53 | #endif -------------------------------------------------------------------------------- /units.hpp: -------------------------------------------------------------------------------- 1 | #include "df/unit.h" 2 | 3 | struct unit_hook : public df::unit 4 | { 5 | typedef df::unit interpose_base; 6 | 7 | DEFINE_VMETHOD_INTERPOSE(uint8_t, getCreatureTile, ()) 8 | { 9 | if (rendering_remote_map && !this->flags1.bits.inactive) 10 | { 11 | df::coord _pos = Units::getPosition(this); 12 | 13 | if (df::global::cursor->x != _pos.x || df::global::cursor->y != _pos.y || df::global::cursor->z != _pos.z || ui->main.mode == df::ui_sidebar_mode::Default) 14 | if (pos.x-mwindow_x >= 0 && pos.y-gwindow_y >= 0 && pos.x-mwindow_x < curwidth && pos.y-gwindow_y < curheight) 15 | if (!((uint32_t*)screen_under_ptr)[(_pos.x-mwindow_x)*curheight + _pos.y-gwindow_y]) 16 | ((uint32_t*)screen_under_ptr)[(_pos.x-mwindow_x)*curheight + _pos.y-gwindow_y] = ((uint32_t*)screen_ptr)[(_pos.x-mwindow_x)*curheight + _pos.y-gwindow_y]; 17 | } 18 | 19 | return INTERPOSE_NEXT(getCreatureTile)(); 20 | } 21 | 22 | // Corpses are rendered as items so this is not needed 23 | /*DEFINE_VMETHOD_INTERPOSE(uint8_t, getCorpseTile, ()) 24 | { 25 | if (rendering_remote_map) 26 | { 27 | df::coord _pos = Units::getPosition(this); 28 | 29 | if (df::global::cursor->x != _pos.x || df::global::cursor->y != _pos.y || df::global::cursor->z != _pos.z || ui->main.mode == df::ui_sidebar_mode::Default) 30 | if (pos.x-mwindow_x >= 0 && pos.y-gwindow_y >= 0 && pos.x-mwindow_x < curwidth && pos.y-gwindow_y < curheight) 31 | if (!((uint32_t*)screen_under_ptr)[(_pos.x-mwindow_x)*curheight + _pos.y-gwindow_y]) 32 | ((uint32_t*)screen_under_ptr)[(_pos.x-mwindow_x)*curheight + _pos.y-gwindow_y] = ((uint32_t*)screen_ptr)[(_pos.x-mwindow_x)*curheight + _pos.y-gwindow_y]; 33 | } 34 | 35 | return INTERPOSE_NEXT(getCorpseTile)(); 36 | }*/ 37 | 38 | DEFINE_VMETHOD_INTERPOSE(uint8_t, getGlowTile, ()) 39 | { 40 | if (rendering_remote_map && !this->flags1.bits.inactive) 41 | { 42 | df::coord _pos = Units::getPosition(this); 43 | 44 | if (df::global::cursor->x != _pos.x || df::global::cursor->y != _pos.y || df::global::cursor->z != _pos.z || ui->main.mode == df::ui_sidebar_mode::Default) 45 | if (pos.x-mwindow_x >= 0 && pos.y-gwindow_y >= 0 && pos.x-mwindow_x < curwidth && pos.y-gwindow_y < curheight) 46 | if (!((uint32_t*)screen_under_ptr)[(_pos.x-mwindow_x)*curheight + _pos.y-gwindow_y]) 47 | ((uint32_t*)screen_under_ptr)[(_pos.x-mwindow_x)*curheight + _pos.y-gwindow_y] = ((uint32_t*)screen_ptr)[(_pos.x-mwindow_x)*curheight + _pos.y-gwindow_y]; 48 | } 49 | 50 | return INTERPOSE_NEXT(getGlowTile)(); 51 | } 52 | }; 53 | 54 | IMPLEMENT_VMETHOD_INTERPOSE(unit_hook, getCreatureTile); 55 | // IMPLEMENT_VMETHOD_INTERPOSE(unit_hook, getCorpseTile); 56 | IMPLEMENT_VMETHOD_INTERPOSE(unit_hook, getGlowTile); 57 | 58 | void enable_unit_hooks() 59 | { 60 | INTERPOSE_HOOK(unit_hook, getCreatureTile).apply(true); 61 | // INTERPOSE_HOOK(unit_hook, getCorpseTile).apply(true); 62 | INTERPOSE_HOOK(unit_hook, getGlowTile).apply(true); 63 | } 64 | --------------------------------------------------------------------------------