What happened to OC? - CLOSED Carnage?!

mouseboyx

Member
  • Content count

    71
  • Joined

  • Last visited

  • Raffle Tickets

    0

Reputation Activity

  1. mouseboyx liked a post in a topic by PiRate in lua os.clock() for timing recurring events?   
    Internally lua uses C's clock() function:
    static int os_clock (lua_State *L) { lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC); return 1; } (lua_Number is typically double)
    Script failure aside, cppreference indicates the function should not be used as a wall clock as you desire, because clock() approximates CPU time. Additionally,
    As clock_t and CLOCKS_PER_SEC are implementation-defined, it would be difficult to immediately decide if this the issue you're running into without knowing the specific compiler version and flags used.
  2. Takka liked a post in a topic by mouseboyx in Public Selective Mute   
    This is a janky script so I'm not going to release it, but you can use it if you want.  SAPP's EVENT_CHAT api is somewhat limited so this is the only way I could find to accomplish this.  All chat messages are stopped unless they are / commands and then they are rebroadcasted as server messages without the server prefix.  The messages are formatted to appear like player chat messages for team and all chat.  Doing that makes it so specific messages to/from players can be muted on an individual basis.  If somebody is trolling and you've had enough of their offensive text this could come in handy to anyone on the server. 
     
    There are no administrative privileges required to run these commands:
    If you want to mute messages to yourself from a specific player use /deafen <player index>  you can use /players to view player indexes, you can also use /undeafen to resume chat messages.
     
    There might be some holes in the logic for this but this is the only way I could think to accomplish this.  Also vehicle chat isn't accounted for, it's lumped into team chat messages.
     
     
    selective_mute.lua
  3. Takka liked a post in a topic by mouseboyx in Public Selective Mute   
    This is a janky script so I'm not going to release it, but you can use it if you want.  SAPP's EVENT_CHAT api is somewhat limited so this is the only way I could find to accomplish this.  All chat messages are stopped unless they are / commands and then they are rebroadcasted as server messages without the server prefix.  The messages are formatted to appear like player chat messages for team and all chat.  Doing that makes it so specific messages to/from players can be muted on an individual basis.  If somebody is trolling and you've had enough of their offensive text this could come in handy to anyone on the server. 
     
    There are no administrative privileges required to run these commands:
    If you want to mute messages to yourself from a specific player use /deafen <player index>  you can use /players to view player indexes, you can also use /undeafen to resume chat messages.
     
    There might be some holes in the logic for this but this is the only way I could think to accomplish this.  Also vehicle chat isn't accounted for, it's lumped into team chat messages.
     
     
    selective_mute.lua
  4. Takka liked a post in a topic by mouseboyx in Detect vpn or proxy   
    What the script does:
        The script will log instances of players connecting using a vpn or proxy in the haloded directory under the filename vpn_log.txt
        It will also announce to all admins on the server when someone joins with a vpn or proxy
        The script enables the command
        /vpn <player index>
        for admins to check if a player is currently playing on a vpn or proxy
     
    The setup of this script requires web hosting, the sapp http client, and requires creating a free account on https://iphub.info/.  (iphub.info allows 1,000 free ip lookups per day)
    The web hosting needs support for PHP and needs to have the Curl module for PHP installed, it would be ideal to have web hosting with an ssl certificate to enable https:// communication
    The readme.txt goes into detail on the setup instructions, but doesn't include detailed web server setup instructions.  Look for guides on how to install a LAMP web server on a vps, or use web hosting that allows ssh access.  With ssh access, this script is valuable in enabling a free ssl certificate https://github.com/srvrco/getssl#installation
     
    vpn_detector.zip
  5. Takka liked a post in a topic by mouseboyx in SAPP Scripting Competition   
    Submission 1
    Detect whether a player joins with a vpn or proxy:
    https://opencarnage.net/index.php?/topic/8548-detect-vpn-or-proxy/
  6. Takka liked a post in a topic by mouseboyx in Show Player Botscore   
    This is a utility for admins to get real time feedback of a specific player's botscore.  aimbot_ban must be enabled for this to work.  If you want to measure botscores, but don't want sapp to kick or ban any players put
    aimbot_ban 20000 4 1 in the sapp init.txt
     
    The admin_botscores.lua script enables 2 commands:
    /botscore [player index] use to show the botscore of a specific player /stopbotscore use to disable botscore messages for yourself You can configure the script to either output the messages to the halo console (default), or the halo chat, whichever you prefer.  Each admin player can monitor any player including themselves.
     
    Here's a video showing how it works.  I'm not using any cheating software in the video.  I'm trying my best as a human to track a stationary player's head through a wall.
     
    admin_botscores.lua
  7. Takka liked a post in a topic by mouseboyx in Show Player Botscore   
    This is a utility for admins to get real time feedback of a specific player's botscore.  aimbot_ban must be enabled for this to work.  If you want to measure botscores, but don't want sapp to kick or ban any players put
    aimbot_ban 20000 4 1 in the sapp init.txt
     
    The admin_botscores.lua script enables 2 commands:
    /botscore [player index] use to show the botscore of a specific player /stopbotscore use to disable botscore messages for yourself You can configure the script to either output the messages to the halo console (default), or the halo chat, whichever you prefer.  Each admin player can monitor any player including themselves.
     
    Here's a video showing how it works.  I'm not using any cheating software in the video.  I'm trying my best as a human to track a stationary player's head through a wall.
     
    admin_botscores.lua
  8. Takka liked a post in a topic by mouseboyx in Show Player Botscore   
    This is a utility for admins to get real time feedback of a specific player's botscore.  aimbot_ban must be enabled for this to work.  If you want to measure botscores, but don't want sapp to kick or ban any players put
    aimbot_ban 20000 4 1 in the sapp init.txt
     
    The admin_botscores.lua script enables 2 commands:
    /botscore [player index] use to show the botscore of a specific player /stopbotscore use to disable botscore messages for yourself You can configure the script to either output the messages to the halo console (default), or the halo chat, whichever you prefer.  Each admin player can monitor any player including themselves.
     
    Here's a video showing how it works.  I'm not using any cheating software in the video.  I'm trying my best as a human to track a stationary player's head through a wall.
     
    admin_botscores.lua
  9. Takka liked a post in a topic by mouseboyx in Halo Alt Codes   
    I used AutoHotkey to type characters ANSI 0128-0255 and ASCII 1-255 alt codes over halo chat and then save the results in a couple of files.  It might be useful for someone somewhere along the line.  The files have only been written to by lua file i/o operation.  If you want to use these characters in a script I recommend opening them with notepad++ then saving your current script as ANSI encoding then copy and paste the characters.  I don't know if this is all of the possible characters, there may be some missing.
     
    I'm curious if anyone knows, will halo will accept other encodings in addition to ascii and ansi within chat or within player names?
    ansi.txt
    ascii.txt
  10. mouseboyx liked a post in a topic by Chalwk in Vehicle Spawner   
    A custom vehicle spawner that works on any game mode.
     
    This was designed to fix a problem with vehicles that are created using
    spawn_object() or execute_command("spawn ... ") on race game types - they do not respawn at the origin x,y,z.
     
    NOTE:
    If you're using this on any RACE game type,
    you must set the game type flag "VEHICLE RESPAWN TIME" to NEVER.
     
    Made in response to this post.
     
    ~edit:
    Updated with a bug fix (vehicle respawn timer wasn't being reset when someone enters it).
     
     
    Vehicle Spawner.lua
  11. mouseboyx liked a post in a topic by Chalwk in spawn command vehicles don't respawn in race gametype   
    Yes, this behaviour is very strange and I too have experienced this.
    I wrote you a custom vehicle spawner script that allows you to spawn vehicles at any x,y,z location and they will respawn at the defined x,y,z within a defined time frame.
     
    See this post.
  12. mouseboyx liked a post in a topic by Enclusion in Halo Server Query Python Script   
    Hello! I was on the reclaimers discord the other day and saw someone post information about querying halo servers. I figured this would be something that might be useful so I wrote this quick little python script that will allow you to retrieve a server's information as a dictionary. Let me know what you think, I threw this together pretty quickly.
     
    https://github.com/TagiaNetwork/halo-server-query-py
     
    Example Usage:
    from pprint import PrettyPrinter from haloserverquery import queryServer printer = PrettyPrinter(indent=4) serverInfo = queryServer("127.0.0.1", 2302) printer.pprint(serverInfo) Example Output:
    { 'dedicated': '1', 'final': 'Sapp', 'fraglimit': '50', 'game_classic': '0', 'game_flags': '26', 'gamemode': 'openplaying', 'gametype': 'Slayer', 'gamevariant': 'TeamPistols', 'gamever': '01.00.10.0621', 'hostname': 'server name', 'hostport': '23900', 'mapname': 'carousel', 'maxplayers': '16', 'nextmap': 'carousel', 'nextmode': 'TeamPistols', 'numplayers': '7', 'password': '0', 'player_flags': '1101561860,136', 'players': { 0: { 'name': 'Extreme', 'ping': '108', 'score': '0', 'slot': 0, 'team': '0'}, 1: { 'name': 'ext', 'ping': '90', 'score': '30', 'slot': 1, 'team': '1'}, 2: { 'name': 'sL Bryan', 'ping': '90', 'score': '13', 'slot': 2, 'team': '0'}, 3: { 'name': 'Lizmari', 'ping': '96', 'score': '8', 'slot': 3, 'team': '0'}, 4: { 'name': 'timefreeze', 'ping': '110', 'score': '2', 'slot': 4, 'team': '0'}, 5: { 'name': 'gjldfaghgk', 'ping': '85', 'score': '1', 'slot': 5, 'team': '1'}, 6: { 'name': 'PAUL S2', 'ping': '98', 'score': '4', 'slot': 6, 'team': '1'}}, 'queryid': '1.1', 'sapp': '10.2.1 CE', 'sapp_flags': '1', 'score_t0': '23', 'score_t1': '37', 'team_t0': 'Red', 'team_t1': 'Blue', 'teamplay': '1'}  
  13. mouseboyx liked a post in a topic by Chalwk in Zombies 2022   
    Introducing a brand new, fully configurable Zombies game type.
     
    Current Version: 1.20
    As this script is new, it's possible that there may be bugs.
    Please report any bugs and feedback here - script changelogs are posted on the same page.
     
    Introduction
    Players in zombies matches are split into two teams: Humans (red team) and Zombies (blue team).
    When a human dies, they switch to the zombie team. A human's goal is to remain alive (uninfected) until
    the end of the round, while a zombie's goal is to kill (infect) as many humans as possible.
     
    When only one human remains, that human becomes the "Last Man Standing".
    The Last Man Standing is given unique player traits; including a waypoint revealing
    their location to zombies, making survival an extreme challenge, among other traits.
     
    See more on traits in the features section below.
     
    The players who start a round as zombies are Alpha Zombies.
    Alpha Zombies have unique player traits to distinguish them from standard zombies.
     
    Standard Zombies are:
    Humans who have been infected. Players who joined after a game has already begun will get standard-zombie status. Humans who commit suicide will get standard-zombie status.  
    Zombies have melee weapons at their disposal and are capable of killing humans in a single blow.
    Humans are given short - and medium-range firearms.
     
    Game Type Features:
     
    Team Balance:
    The players who start a round as zombies are Alpha Zombies.
    The script will dynamically determine how many Alpha Zombies there should be based on how many players are online.
     
    Zombies can be cured (on by default):
    A zombie needs 3 (default) consecutive kills to become human again.
    * You can configure the kill threshold.
     
    Nav Marker (off by default):
    When enabled, the last man standing will have a nav marker above his head.
    Note: The kill-in-order game type flag must be set to YES and the objectives indicator flag must also be set to NAV POINTS.
     
    Game Messages:
    Fully configurable game messages.
     
    Game Objects:
    Interaction with weapons, vehicles & equipment can be individually blocked/allowed for Red Team, Blue Team or both teams.
    Default: All objects are disabled for zombies except for health packs.
    Humans can use vehicles. Alpha Zombies will have to throw stickies on the vehicles to kill them.
     
    Teams:
    You can set the teams. 
    Humans are on the red team by default. Zombies are on the blue team by default.
    But you can change that if you so desire.
     
    No Zombies Left? No Worries!
    When there are no zombies (suppose they all left), a timer will count down from 5 seconds (default).
    After the countdown lapses, a random Human will be selected to become a (standard) zombie.
     
    Game Start Delay
    The game requires a minimum of 2 (default) players online before a pre-game countdown from 5 (default) seconds is initiated.
    After which the map is reset and the game commences.
     
    Traits:
    Alpha Zombies:
    Speed                                  1.5x Health                                  2x Normal Health (200%) Respawn Time                    1.5s Grenades                            2x plasmas Weapon                               Plasma rifle Damage                              10x normal damage Abilities                               Can camouflage while crouching Standard Zombies:
    Speed                                  1.4x Health                                  Normal Health (100%) Respawn Time                    2.5s Grenades                            0 Weapon                               Skull (oddball) Damage                              10x normal damage Abilities                               None Humans:
    Speed                                  Normal speed (1) Health                                  Normal Health (100%) Weapons                             Pistol, Shotgun, Assault Rifle Respawn Time                    3s Grenades                            Two of each Damage                              1x normal damage Abilities                               Can use Vehicles Last Man Standing:
    Speed                                  1.5x Health                                  Normal Health (100%) Weapons                             Map default (no custom assignments) Respawn Time                    1s Grenades                            Four of each Damage                              2x normal damage Abilities                               Can use Vehicles and is capable of regenerating health by 0.0005 units per 30 ticks  
    Please download Zombies on my GitHub release page (link below).
    The release contains three files:
    Zombies.lua (sapp script)
    Zombies-PC (custom game type)
    Zombies-CE (custom game type)
     
    DOWNLOAD PAGE
  14. mouseboyx liked a post in a topic by Chalwk in SAPP map_skip can be abused   
    I also made a Delay Skip script if anyone is interested.
    Click to view
  15. mouseboyx liked a post in a topic by AntiMomentum in How to install wine version 1.7 on Ubuntu 20.04?   
    Strange, I use the same install script for Debian 9, Ubuntu 20.04 LTS, Ubuntu 21.04 and Ubuntu 18.04 LTS to install Wine and it runs sapp 10.2.1 with or without UPX. 
    This script installs Wine 5.0 on Ubuntu 20.04, Wine 3.0 in Ubuntu 18,  and Wine 1.8.7 on Debian 9 Stretch. But it does correctly run my halo server.
    https://github.com/antimomentum/haloce/blob/master/Debianwineinstall.sh

    You may want to remove/comment out the first line if you run this on Ubuntu. Tbh I've forgotten to do that and it still worked in Ubuntu anyways xD
     
    In Ubuntu 18.04 LTS I did have to do apt install wine32 manually after running the script.

    This installs 32bit Wine on 64bit Alpine. This is the only version of 64bit Alpine I've found that would run my halo server correctly:
    https://github.com/antimomentum/haloce/blob/master/Alpine64bit-3.12-Wine32bitinstaller.sh

    However i386 versions of Alpine do tend to work too, like the one pulled in the Dockerfile.


    No UPX sapp files, at the bottom of the page
    http://halopc.com/sv_extensions/

    smol bitmaps.map file if you want it (I use this personally, not required)


    I also just went ahead and uploaded my server files as an example.
    halopull.zip
    *Edit*
    When Halo server starts it will ask the OS to do dns lookups in both Windows and Linux by default for the master server ip. These two commands will allow the Halo server to skip the dns lookup in Linux, only needs to be run once on a fresh OS:
    echo "34.197.71.170 hosthpc.com" >> /etc/hosts
    echo "34.197.71.170 s1.master.hosthpc.com" >> /etc/hosts

    As a side note Windows has a hosts file as well.

    **Edit 2**
    UFW might also be automatically installed on your Linux VPS. UFW (uncomplicated firewall) is a frontend for iptables. This could end up blocking Halo from reaching the master server by default and preventing Halo from booting properly/showing in the list.
    Try:
    ufw stop
    to stop it until reboot or manually started
    ufw disable
    to persistently disable it.

    As a side note the firewall.sh script on my Github requires ufw to be stopped/disabled and to have the master server in hosts (the two echo commands above). More details about my fw are at the top of the firewall sript.
  16. MXWK liked a post in a topic by mouseboyx in How to install wine version 1.7 on Ubuntu 20.04?   
    10.2.1 is the latest version of sapp.dll
    1.10 is the latest version of haloceded.exe  http://hce.halomaps.org/index.cfm?fid=6797
     
    I'm unsure which version of haloceded.exe is included in the download from http://xhalo.byethost18.com/, but I don't think you want that version, it's definitely not 1.10.  That's also a very old version of sapp.dll from the looks of the web page.
     
    Edit:
    You can also get haloceded.exe from here, but the version of sapp.dll included with it doesn't work on linux https://www.elitegameservers.net/sapp/download you would replace or use the sapp.dll and strings.dll with the ones from https://opencarnage.net/applications/core/interface/file/attachment.php?id=1154 to get it to work on linux.
     
  17. MXWK liked a post in a topic by mouseboyx in How to install wine version 1.7 on Ubuntu 20.04?   
    This doesn't answer your question, but this post ended up fixing my issues:
    I wasn't able to get sapp to run on ubuntu 20.04 unless I used the version of sapp linked in the above post.  However, I'm using a 1.10 version of haloded.exe I'm not sure whether it would work with previous versions.  What patch version of haloceded.exe are you using?  I was able to run wine 5.0 with haloded 1.10 and sapp 10.2.1 on ubuntu 20.04 by using the SAPP.7z download in the above post.
     
    Make sure you run haloded in a 32bit wine prefix also:
    https://askubuntu.com/questions/177192/how-do-i-create-a-32-bit-wine-prefix
  18. MXWK liked a post in a topic by mouseboyx in CD Key Check Is ON In My CE SAPP Server   
    I honestly have never tested changing that memory address, I was thinking that with sapp 10.2.1 the cd key check is disabled out of the box.
     
    I tried some code, this ended up crashing haloded with an exception error, but I'm using sapp 10.2.1.  With 10.2.1 I never had a problem with cd key checks, I also don't know if those memory addresses or correct, or when to write to them.  It could be a completely different address that is created by sapp that needs to be changed.  Those addresses in offsets.lua probably pre-date halo patch 1.10 and are geared towards phasor.
    api_version = "1.12.0.0" function OnScriptLoad() register_callback(cb["EVENT_GAME_START"], "OnGameStart") end function OnGameStart() --PC --hashcheck_patch = 0x59c280 --CE hashcheck_patch = 0x530130 write_byte(hashcheck_patch, 0xEB) -- Disables Halo's hash check (0x74 to reenable) end  
     
  19. MXWK liked a post in a topic by mouseboyx in CD Key Check Is ON In My CE SAPP Server   
    The unrestricted version of Gandanur: http://www.gandanur.com/
    It has a command for disabling the cd-key check, however installation of Gandanur requires replacement of haloded.exe and strings.dll.  It might be possible to use gandanur along with cheat engine and keep running the command:
    sv_cdkeycheck 1 sv_cdkeycheck 0 sv_cdkeycheck 1 sv_cdkeycheck 0 etc... Then use cheat engine to search for a bit value in haloded.exe of something being toggled between 0 and 1 based on what you changed it to using gandanur, however the fact that gandanur requires haloded.exe to be replaced with their own version makes me think that the memory address may or may not be correct if you tried to write to the same address in the copy of haloded.exe that sapp uses.
     
    If this doesn't work then gandanur is a solution for disabling the cd key check if you don't want to use phasor or sapp.
     
    Edit:
    I didn't test to see whether this works, but there is a memory address specified here:
    https://github.com/Chalwk77/HALO-SCRIPT-PROJECTS/blob/ca1bcdf2636debc4e3622fff48614626bb7b3043/Miscellaneous/offsets.lua
    --PC --hashcheck_patch = 0x59c280 --CE hashcheck_patch = 0x530130 write_byte(hashcheck_patch, 0xEB) -- Disables Halo's hash check (0x74 to reenable)  
  20. mouseboyx liked a post in a topic by Virusky in Halo Highest Resolution   
    Should have mentioned I have chimera installed. Howver I did try -vidmode 1600,900,60 and it wasn't capped to 30 frames in campaign anymore.
  21. Takka liked a post in a topic by mouseboyx in Halo Highest Resolution   
    If you have chimera installed then I'm not sure how to troubleshoot the issue, but if you don't have chimera then this is what I would try:
     
    If you right click and select properties of the halo shortcut either in program files or on the desktop, then add a space to the end of the target line after the quotes " " to make it look like:
     
    ... halo.exe" -vidmode 1600,900,60
    it works like:
    -vidmode width,height,monitor hz
     
    I think using -vidmode will force vsync but it should run the game at the monitors refresh rate rather than 30 fps
     
    If your monitor is capable of more than 60hz change it to whatever it can accept at 1600x900
     
    You can also try running it in windowed mode to see if that changes anything
    ... halo.exe" -window -vidmode x,y,hz
    or
    ... halo.exe" -window
  22. Vuthakral liked a post in a topic by mouseboyx in Funny Pictures and Videos (one per post)   
    Sorry I didn't know how the image uploading works, this is what it's supposed to be.
  23. mouseboyx liked a post in a topic by Chalwk in Name Replacer   
    Script: Name Replacer
    Description: Change blacklisted names into something funny!
     
    During pre-join, a player's name is cross-checked against a blacklist table.
    If a match is made, their name will be changed to a random one from a table called "random_names".
     
    As random names get assigned, they become marked as "used" until the player quits the server.
    This is to prevent someone else from being assigned the same random name.
     
     
     
    Name Replacer.lua
  24. mouseboyx liked a post in a topic by Chalwk in Frag Nation (mini game)   
    Frag Nation, for SAPP (PC & CE)

    Description:

    Frag Nation is a grenade only mini-game.
    Each player is given two of each grenade and an empty plasma pistol.
    Every time you kill a player (with a grenade), you will be rewarded with a grenade(s).
    If you have no grenades, you will be limited to melee-combat.

    * Refer to config section for more info.
     
    Features:
    Set the number of starting grenades (on spawn) Define primary weapon (default: plasma pistol) Change ammo, mag & battery for the primary weapon (no ammo by default) Prevent interaction with map objects (weapons, vehicles, equipment)  Prevent map objects from spawning at all (weapons, vehicles, equipment)  Optional kill message: i.e, "+2 frags, +1 plasma" Grenade Bonuses (per kill):  frag explosion (+1) plasma explosion (+1) sticky plasma (+2)  
    Download Link
  25. Enclusion liked a post in a topic by mouseboyx in ffi async curl development   
    I want to preface this by saying that I had not written any C++ before I started working on this, and also that I don't know how to manage memory within C++.  I would not recommend using this on your halo server because it could potentially crash it if not used correctly.  This is more like an overview of how an async C function call can work within lua.  The .dll seems to work under the circumstances, but I don't know how everything works within the C++ code, so it definitely shouldn't be used in any production environment.
     
    I would not have been able to figure out how to make the dll if it were not for these posts, I used the structure from Discord Webhooks Script dllmain.cpp, and the lua timer structure from the sapp http client, also special thanks to a halo player named dummkopf.
     
    Using Visual Studio 2019 on Windows 10, I followed this guide to setup the environment with libcurl to compile the dll https://medium.com/@farhabihelal/how-to-set-up-libcurl-on-visual-studio-2019-a9fdacce6945
     
    The dll can only make one request at a time, lua can pass in a url and post data through the request, and the request is completed asynchronously.  I'm fairly confident halo will not lag no matter how long the webserver takes to respond.  The text response is stored in an lua variable so that you can do whatever needs to be done with it.  It sort of performs an http get and post request at the same time where get variables are passed through the query string, and the post data is passed to the 2nd parameter of curl_request().  If any of the C functions are called out of order then it could crash the server, and I haven't figured out how to create curl request instances, thus only one request at a time, then wait, then make the next one.  The dllmain.cpp could be modified from documentation https://curl.se/libcurl/c/libcurl-easy.html to perform any http method, however the compiled dll in the zip only supports http get/post.  There are lots of comments in the sources to help.
     
    The curl_test.7z includes:
    dllmain.cpp - C++ code that can compile with visual studio 2019
    curl_test.dll - dll that I compiled with visual studio 2019 (put this in the same directory as haloded.exe)  I didn't test this on wine or anything other than windows 10
    curl_test.lua - example lua script that allows curl_test.dll to be loaded and called
    sleep.php - put this at the root directory of a web server with PHP installed (you can install xampp and put it in C:\xampp\htdocs)  This was mainly for testing whether curl was performed using async and to echo back post variables
     
    Honestly though if someone has experience writing C/C++ out there this is a decent enough base to create C functions that won't lag the halo server, but the C++ that I cobbled together is not very good due to my lack of understanding of C++.  I guess I'm looking for someone to come and improve this idea, but I might try to figure out a better way of doing it after I learn more.
     
    Problems running with wine:
    I was testing the dll included in the zip, and it looks like I compiled it in debug mode rather than release mode, also I attempted to ffi load the dll while running haloded.exe through wine and it asks for VCRUNTIME140D.dll and ucrtbased.dll which could not be found it led me to this https://stackoverflow.com/questions/6261034/building-dll-for-lower-version-of-visual-studio which it looks like it will be necessary to learn about the solutions described in this question in order to compile a working dll for wine. 
    The VC++ 2010 runtime has a platinum rating on winehq.org, https://appdb.winehq.org/objectManager.php?sClass=application&iId=5766, my assumption is to somehow obtain a legitimate copy of visual studio 2010 or the VC++ 2010 compiler and compile the dll using that.  Then use: winetricks vcrun2010 within the 32bit wine prefix that the halo server is run in.  In addition visual studio 2010 would somehow have to work with libcurl, which hopefully it would.
     
    Ignore the grayed out text, if you open the solution properties in visual studio 2019 before writing any code, then specify the platform toolset as the 2015 version, not the 2015 xp version, then the compiled dll will work under wine after running: winetricks vcrun2015 within the 32 bit wine prefix, and make sure to compile in release mode and not debug mode, or wine will throw an error trying to load the dll, I also uploaded the VC++ 2015 version of the dll as culr_test_wine.dll.7z, it has an identical source to the dllmain.cpp, only that it works with wine, and should work on windows as well after installing the VC++ 2015 runtime.  Using winetricks vcrun2015 over ssh may require the ssh -X option to forward x11 applications because there is a graphical popup to accept the Microsoft terms of the redistributable.  I would really like to find a way to compile the dll without the need for any runtime redist, but I haven't figured that out.
     
    Other Notes:
    If some protection were added with extra bool values within the dllmain.cpp and wrapping some of the code within an if statement so that certain functions could only be called after others had been completed then improper usage of the C functions causing the server to crash could most likely be avoided.
     
    There should probably be an if statement within do_curl() in dllmain.cpp so that if you pass an empty string as the 2nd parameter in lua like:
    curl_client.curl_request("http://localhost/sleep.php?wait_time=4","") Then curl should not perform with  any post data or so that post would not be a part of the request, because sending post data to a dynamic web page whether it be PHP or anything, if the page is setup in such a way that you send post data when it doesn't expect any or doesn't need any it could possibly fail on the server side.  I don't have an example of this happening, but it would be a good idea to have it operate like a switch rather than sending blank post data.  In other words, wrap curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post_data); in an if statement so that if post_data is an empty string don't include it in the request.
     
    There is no current error reporting or checking, get_curl_status()==true only means that the curl portion of the C++ has completed, if curl was unable to contact the web server there's no real way to tell.  I believe if it failed you'll get back an empty string "" from get_curl_text_response() yet if you were already expecting an empty response from the web server it would be difficult to discern whether there was an error.
     
    Queue of requests:
    curl_test_queue.7z contains:
    curl_test_queue.lua  This is one example of how lua can create a queue for curl_test_wine.dll, an lua table of outgoing requests can be done one after another, where the timer loop is constantly running checking for more data in the table, sending all of it out until there's no more entries in the table.  There's probably also a way to trigger the timer loop rather than to have it constantly running if there's no data to be sent, but I didn't include that in the code.
    log_player.php  This appends the data sent from lua to the http server to a file in the same directory where the php script is located called halo_players.txt that contains the name of the player who joined and the current unix timestamp.  It has to be run within a web server compatible with php.
     
    Setting custom headers:
    Sorry for this messy edited timeline of work, but curl_test_headers.7z works the same as curl_test_wine, however lua is given the opportunity to pass custom headers using the curl rules outlined in this doc https://curl.se/libcurl/c/httpcustomheader.html I believe I also fixed a memory leak in the program, but I don't have any way to know for sure, or don't know how. I also added some protection for the functions just in case they get called out of order.  So this should be considered the "stable version" although relatively "stable" compared to previous attempts.  I've played a little with this code https://gist.github.com/ianklatzco/c033b33757915feaf48fd0caf14b42cb for running curl from bash to communicate with a discord bot, but I vaguely remember there needing to be an initial authorization that has to be done before the bot will accept requests, which may or may not hinder trying to create one in within lua using this dll.
     
    Setting custom method:
    It's on my todo list to add an lua counterpart to add an option and parameter to change this libcurl function:  curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, <string from lua here>);  so that something like "DELETE", "PATCH", or "PUT" etc... can be used.
     
    sapp_curl_1.7z:
    I'm happy with the way this turned out and I did some testing with it and included 2 examples of how sapp_curl_1.dll can be used within lua to query the discord API, and in turn instruct a discord bot to do things.
    Due to the massive number of options here: https://curl.se/libcurl/c/curl_easy_setopt.html I think it would be wise to stop development.  The dllmain.cpp could easily be restructured to include any of those options, but sapp_curl_1.dll is simple enough to get started with http api requests or sending any http method along with data.  There is a quirk where if you are sending JSON data with sapp_curl_1.dll it may have been a good idea to format that as UTF-8 within the .dll, but it may be possible to do that within lua.  I might try to figure out either method whether lua or cpp to send special characters, but the fix that I've put in the discord lua examples is a hack method that is reliable at changing the data to be acceptable but won't send special characters.  I believe that the post data must be ASCII encoded.  The included examples go into a lot more detail of usage, so I'm not going to put that information here, but you can set custom headers, and set custom request methods, and custom post data, and turn standard output messages on and off. 
     
    It looks like attempting to detect the charset given to sapp_curl_1.dll and then convert to utf-8 is a problem that would require quite a bit of work.  I'm unsure how lua is deriving the charset from any data that is passed to it, so it could possibly be any charset.  Making a list of all the ascii characters and making sure that the data you send is one of those characters seems like an easy fix, but no special characters are able to get sent.  If there was a way to force lua to encode a particular string with a certain charset all the time once it's sent to sapp_curl_1.dll it would make life a lot easier, but there are also ways of detecting charsets within a C/C++ program, however there are quite a few that would need to be set up to be detected.  I even went so far as to think that possibly url encoding then url decoding the string, or somewhere in the process of doing that might make this easier to figure out https://help.interfaceware.com/code/details/urlcode-lua send all post data as a url encoded string, then you could decode it once it was passed to the dll, however that seems like a wild goose chase.  I've hit a point where I need to learn more before being able to make improvements: https://stackoverflow.com/questions/16208079/how-to-work-with-utf-8-in-c-conversion-from-other-encodings-to-utf-8  
     
    Nevermind the issue above is solved in with this stackoverflow question: https://stackoverflow.com/questions/16624036/how-to-convert-windows-1256-to-utf-8-in-lua it probably works for both halo chat and names chosen in halo.  There is also probably some usage of lua's string.byte() that can be done beforehand to make sure you aren't trying to convert a string with a character represented by a byte valuer greater than 255.  It makes me think about the halo name hack program and I'm wondering if it would inject characters into a player's name that have a byte value greater than 255, I don't know enough about how the halo client/server handles names and chat strings in order to give a solution that will always work even if someone was being naughty with the strings that you can get from get_var(PlayerIndex,"$name") and also the Message parameter from register_callback(cb["EVENT_CHAT"], "OnPlayerChat") in sapp.
     
    sapp_curl_2.7z is the current version:
    I fixed a dumb mistake by making sure: curl_slist_free_all(chunk); gets called, this probably would have been bad over long periods of use.
     
    I did some unorthodox stress testing attempting to see how reliable the dll was.  I did ~500,000 requests at ~250 requests per second with everything being done over localhost, and 99 header rules, and 1000 characters of data per request.  So far as I can tell the memory usage of the machine I was running it on while running with wine did not increase as if there was a leak.  Connecting to the halo server through localhost while this was going on with 1 player it seemed as everything was normal, which seemed kind of comical because haloded.exe was hovering around 20% cpu usage (i5 6600k).
     
    Errors:
    As of the time of writing this there is no error reporting for curl within the dll, you are at the mercy of the api endpoint to give relevant errors, but an empty string "" will be returned if curl fails for whatever reason.  An example would be the webserver not being able to be contacted because there is no webserver running at the hostname of the url does not exist, curl will return "" after a pre-defined amount time because the webserver did not exist.  This could happen for any number of reasons, like a dns lookup failed, or you aren't connected to the internet, trying to request from exampel.com instead of example.com, etc...
     
    The name of the sapp_curl_x.dll is arbitrary, and in order to load whichever version you downloaded:
    curl_client = ffi.load("sapp_curl_x")  replace the name within the quotes with the file name of the dll, you can also rename it to anything and use that name instead, and I don't think you have to put .dll on the end in order for lua to load it.
    The dll should be put in the same directory that contains the halo server i.e. the same location of sapp.dll and haloded
     
    Todo list:
    File posting https://curl.se/libcurl/c/postit2.html
    curl_slist_free_all(chunk);  needs to be added when custom headers are specified (Done)
     
    Reason for making this and future thoughts:
    I wanted a portable solution that could contact http api's that was also not going to lag the halo server.  The sapp_http_client is a better option if you only need to make GET requests.
    I'm still wondering whether this sapp curl dll would be compatible with a service like elite game servers, I'm hoping / praying that they have a way to use the VC++ 2015 runtime and will accept the .dll if they are asked to upload it to a service.
    If services like elite game servers will accept the dll then that opens up some lua programming freedom on EGS for script writers to create interactions with http api's that require more than the GET method.  EGS doesn't care too much if you upload any lua script by yourself and write your own lua scripts for sapp.  But they disallow uploading of .dll files unless you open a ticket with them.  The sapp_http_client has already been added to their list of mods that can be "one click" installed, so I'm hoping this can get on that list too, but I would like someone to review the dllmain.cpp before that happens.  Of course improper use of the dll within lua will crash the server, and it could be warped and twisted into a cpu sucking program if used improperly in lua.  I'm hoping it's treated with respect and not abused, waiting 250ms between initiating and processing a request is just an arbitrary number that I put in the examples, but changing that number is up to the lua programmer to decide.
     
    curl_test.7z
    curl_test_wine.dll.7z
    curl_test_queue.7z
    curl_test_headers.7z
    sapp_curl_1.7z
    sapp_curl_2.7z