Commit 8a19852f authored by Neoony's avatar Neoony
Browse files

v0.3 - Built on SourceMod 1.11 (Server must have 1.10.0 or higher) -- Updated...

v0.3 - Built on SourceMod 1.11 (Server must have 1.10.0 or higher) -- Updated forked Socket extension (for SM 1.10.0 compatibility) https://github.com/JoinedSenses/sm-ext-socket -- Updated cURL include files for SM 1.10.0 https://github.com/JoinedSenses/SourceMod-IncludeLibrary/ -- Some small bugfixes
parent 63e78b04
Pipeline #10387 failed with stages
in 5 minutes and 38 seconds
......@@ -67,4 +67,10 @@
- Added sound before the vote starts
- Reduce number of characters in vote menu by only showing max players number
- Added Vote Status with HUD message
- Few bugfixes
\ No newline at end of file
- Few bugfixes
**v0.3**
- Built on SourceMod 1.11 (Server must have 1.10.0 or higher)
- Updated forked Socket extension (for SM 1.10.0 compatibility) https://github.com/JoinedSenses/sm-ext-socket
- Updated cURL include files for SM 1.10.0 https://github.com/JoinedSenses/SourceMod-IncludeLibrary/
- Some small bugfixes
\ No newline at end of file
......@@ -8,16 +8,20 @@
--
# DEPENDENCIES
Now requires SourceMod 1.10.0 or higher
Linux server needs: apt-get install lib32z1
More info for different linux editions:
https://gaming.stackexchange.com/questions/172407/sourcebans-smx-database-failure-could-not-find-driver-mysql/172408#172408
**SOCKET** Extension:
https://forums.alliedmods.net/showthread.php?t=67640
+ SM 1.10.0 forked version: https://github.com/JoinedSenses/sm-ext-socket
**This is included with the plugin.**
**cURL** Extension:
https://forums.alliedmods.net/showthread.php?t=152216
+ SM 1.10.0 include files: https://github.com/JoinedSenses/SourceMod-IncludeLibrary/
**This is included with the plugin.**
--
......
......@@ -22,7 +22,7 @@
#include <socket>
#include <cURL>
#define PluginVer "v0.2"
#define PluginVer "v0.3"
public Plugin myinfo =
{
......@@ -271,7 +271,7 @@ public Action SCommand_LOneTimeForceRedirect(int args)
for (int client = 1; client <= MaxClients; client++)
{
if (IsClientConnected(client))
if (IsClientConnected(client) & IsClientInGame(client))
{
PrintToChat(client, "[L] You have been redirected");
ClientCommand(client, "lobby_redirect %s", full);
......@@ -322,7 +322,7 @@ public void ForceRedirectAll()
GetConVarString(l_forceredirect, ForceRedirectAddr, sizeof(ForceRedirectAddr));
for (int client = 1; client <= MaxClients; client++)
{
if (IsClientConnected(client))
if (IsClientConnected(client) & IsClientInGame(client))
{
PrintToChat(client, "[L] You have been redirected");
ClientCommand(client, "lobby_redirect %s", ForceRedirectAddr);
......@@ -373,7 +373,7 @@ public void BackupRedirectAll()
GetConVarString(l_backupserver, BackupServerAddr, sizeof(BackupServerAddr));
for (int client = 1; client <= MaxClients; client++)
{
if (IsClientConnected(client))
if (IsClientConnected(client) & IsClientInGame(client))
{
PrintToChat(client, "[L] You have been redirected");
ClientCommand(client, "lobby_redirect %s", BackupServerAddr);
......@@ -600,7 +600,7 @@ public Action PopulatedRedirectTmr(Handle timer)
PrintToChatAll("\x04[L] \x01\x07008000Redirecting\x01 players...");
for (int client = 1; client <= MaxClients; client++)
{
if (IsClientConnected(client))
if (IsClientConnected(client) & IsClientInGame(client))
{
PrintToChat(client, "[L] You have been redirected");
ClientCommand(client, "lobby_redirect %s", redirectAddress);
......
......@@ -9,7 +9,7 @@
/*
========================================
The Following CURLOPT_* NOT support:
The Following CURLOPT_* NOT support
ERRORBUFFER // use curl_get_error_buffer
WRITEINFO // ???
PROGRESSFUNCTION // unused
......@@ -52,7 +52,7 @@ CLOSESOCKETDATA // unsupport
/*
========================================
The Following CURLOPT_* supports the "file://" notation.
The Following CURLOPT_* supports the "file //" notation.
COOKIEFILE
COOKIEJAR
RANDOM_FILE
......@@ -70,14 +70,14 @@ SSH_KNOWNHOSTS
/*
========================================
The Following CURLINFO_* NOT support:
The Following CURLINFO_* NOT support
CURLINFO_SLIST
========================================*/
/*
========================================
The Following CURLFORM_* NOT support:
The Following CURLFORM_* NOT support
CURLFORM_PTRNAME
CURLFORM_PTRCONTENTS
CURLFORM_ARRAY
......@@ -149,10 +149,10 @@ enum Openssl_Hash {
* @ param any data Data passed to curl_easy_perform_thread()
* @ noreturn
*/
funcenum CURL_OnComplete
typeset CURL_OnComplete
{
public(Handle:hndl, CURLcode: code),
public(Handle:hndl, CURLcode: code , any:data),
function void (Handle hndl, CURLcode code);
function void (Handle hndl, CURLcode code , any data);
};
/**
......@@ -163,10 +163,10 @@ funcenum CURL_OnComplete
* @ param any data Data passed to curl_easy_send_recv()
* @ return SendRecv_Act
*/
funcenum CURL_OnSend
typeset CURL_OnSend
{
SendRecv_Act:public(Handle:hndl, CURLcode: code, const last_sent_dataSize),
SendRecv_Act:public(Handle:hndl, CURLcode: code, const last_sent_dataSize, any:data),
function SendRecv_Act (Handle hndl, CURLcode code, const int last_sent_dataSize);
function SendRecv_Act (Handle hndl, CURLcode code, const int last_sent_dataSize, any data);
}
/**
......@@ -177,10 +177,10 @@ funcenum CURL_OnSend
* @ param any data Data passed to curl_easy_send_recv()
* @ return SendRecv_Act
*/
funcenum CURL_OnReceive
typeset CURL_OnReceive
{
SendRecv_Act:public(Handle:hndl, CURLcode: code, const String:receiveData[], const dataSize),
SendRecv_Act:public(Handle:hndl, CURLcode: code, const String:receiveData[], const dataSize, any:data),
function SendRecv_Act (Handle hndl, CURLcode code, const char[] receiveData, const int dataSize);
function SendRecv_Act (Handle hndl, CURLcode code, const char[] receiveData, const int dataSize, any data);
}
/**
......@@ -190,22 +190,22 @@ funcenum CURL_OnReceive
* @ param any data Data passed to Openssl_Hash_file()
* @ noreturn
*/
funcenum Openssl_Hash_Complete
typeset Openssl_Hash_Complete
{
public(const bool:success, const String:buffer[]),
public(const bool:success, const String:buffer[], any:data),
function void (const bool success, const char[] buffer);
function void (const bool success, const char[] buffer, any data);
}
funcenum CURL_Function_CB
typeset CURL_Function_CB
{
// CURLOPT_WRITEFUNCTION
public(Handle:hndl, const String:buffer[], const bytes, const nmemb),
public(Handle:hndl, const String:buffer[], const bytes, const nmemb, any:data),
function void (Handle hndl, const char[] buffer, const int bytes, const int nmemb);
function void (Handle hndl, const char[] buffer, const int bytes, const int nmemb, any data);
// CURLOPT_READFUNCTION
public(Handle:hndl, const bytes, const nmemb),
public(Handle:hndl, const bytes, const nmemb, any:data),
function void (Handle hndl, const int bytes, const int nmemb);
function void (Handle hndl, const int bytes, const int nmemb, any data);
}
/*************************************************************************************************/
......@@ -217,7 +217,7 @@ funcenum CURL_Function_CB
* Create a curl handle
* @ return Handle The curl handle. Returns INVALID_HANDLE on failure
*/
native Handle:curl_easy_init();
native Handle curl_easy_init();
/**
* Set a curl option for CURLOPTTYPE_OBJECTPOINT type
......@@ -227,7 +227,7 @@ native Handle:curl_easy_init();
* @ param String buffer The value to set the option to.
* @ return bool 1 on success. 0 = The option not accept string or unsupport.
*/
native bool:curl_easy_setopt_string(Handle:hndl, CURLoption:opt, const char[] buffer);
native bool curl_easy_setopt_string(Handle hndl, CURLoption opt, const char[] buffer);
/**
* Set a curl option for CURLOPTTYPE_LONG type
......@@ -237,14 +237,14 @@ native bool:curl_easy_setopt_string(Handle:hndl, CURLoption:opt, const char[] bu
* @ param cell_t value The value to set the option to.
* @ return bool 1 on success. 0 = The option not accept integer or unsupport.
*/
native bool:curl_easy_setopt_int(Handle:hndl, CURLoption:opt, value);
native bool curl_easy_setopt_int(Handle hndl, CURLoption opt, int value);
/**
* Set a curl option for CURLOPTTYPE_LONG type
* @ example"
new opt[][2] = {
{_:CURLOPT_NOPROGRESS,1},
{_:CURLOPT_VERBOSE,0}
{_ CURLOPT_NOPROGRESS,1},
{_ CURLOPT_VERBOSE,0}
};
*
* @ param Handle hndl The handle of the curl to be used. May be INVALID_HANDLE if not essential.
......@@ -252,7 +252,7 @@ native bool:curl_easy_setopt_int(Handle:hndl, CURLoption:opt, value);
* @ param cell_t array_size The array size.
* @ return bool 1 on success. 0 = The option not accept integer or unsupport.
*/
native bool:curl_easy_setopt_int_array(Handle:hndl, array[][2], array_size);
native bool curl_easy_setopt_int_array(Handle hndl, int[][] array, int array_size); // int array[][2]
/**
* Set a curl option for CURLOPTTYPE_OFF_T type
......@@ -262,7 +262,7 @@ native bool:curl_easy_setopt_int_array(Handle:hndl, array[][2], array_size);
* @ param String buffer The value to set the option to.
* @ return bool 1 on success. 0 = The option not accept string or unsupport.
*/
native bool:curl_easy_setopt_int64(Handle:hndl, CURLoption:opt, const String:buffer[]);
native bool curl_easy_setopt_int64(Handle hndl, CURLoption opt, const char buffer);
/**
* Set a curl option for CURLOPTTYPE_OBJECTPOINT type
......@@ -276,7 +276,7 @@ native bool:curl_easy_setopt_int64(Handle:hndl, CURLoption:opt, const String:buf
* @ param Handle other_hndl The other handle to set the option to.
* @ return bool 1 on success. 0 = The option not accept string or unsupport.
*/
native bool:curl_easy_setopt_handle(Handle:hndl, CURLoption:opt, Handle:other_hndl);
native bool curl_easy_setopt_handle(Handle hndl, CURLoption opt, Handle other_hndl);
/**
* Set a curl option for CURLOPTTYPE_FUNCTIONPOINT type
......@@ -287,7 +287,7 @@ native bool:curl_easy_setopt_handle(Handle:hndl, CURLoption:opt, Handle:other_hn
* @ param cell_t value Value to set.
* @ return bool 1 on success. 0 = The option unsupport or invalid callback function.
*/
native bool:curl_easy_setopt_function(Handle:hndl, CURLoption:opt, CURL_Function_CB:callback, any:value=0);
native bool curl_easy_setopt_function(Handle hndl, CURLoption opt, CURL_Function_CB callback, any value=0);
/**
* Load all CURLoption to curl Handle
......@@ -297,13 +297,13 @@ native bool:curl_easy_setopt_function(Handle:hndl, CURLoption:opt, CURL_Function
* Only can use one time for each curl handle
* @ return The CURLcode code, see cURL_header.inc
*/
native CURLcode:curl_load_opt(Handle:hndl);
native CURLcode curl_load_opt(Handle hndl);
/**
* Perform a file transfer
* @ return The CURLcode code, see cURL_header.inc
*/
native CURLcode:curl_easy_perform(Handle:hndl);
native CURLcode curl_easy_perform(Handle hndl);
/**
* Perform a file transfer, using thread
......@@ -312,7 +312,7 @@ native CURLcode:curl_easy_perform(Handle:hndl);
* @ param cell_t value Value to set.
* @ noreturn
*/
native curl_easy_perform_thread(Handle:hndl, CURL_OnComplete:perform_callback, any:value=0);
native void curl_easy_perform_thread(Handle hndl, CURL_OnComplete perform_callback, any value=0);
/**
* Create a send & receive function for a connected curl handle
......@@ -327,7 +327,7 @@ native curl_easy_perform_thread(Handle:hndl, CURL_OnComplete:perform_callback, a
* @ param cell_t value Value to set.
* @ noreturn
*/
native curl_easy_send_recv(Handle:hndl, CURL_OnSend:send_callback, CURL_OnReceive:receive_callback, CURL_OnComplete:complete_callback, SendRecv_Act:act, send_timeout, recv_timeout, recv_buffer_Size = 1024, any:value=0);
native void curl_easy_send_recv(Handle hndl, CURL_OnSend send_callback, CURL_OnReceive receive_callback, CURL_OnComplete complete_callback, SendRecv_Act act, int send_timeout, int recv_timeout, int recv_buffer_Size = 1024, any value=0);
/**
* Send a signal to a send & receive curl handle
......@@ -335,14 +335,14 @@ native curl_easy_send_recv(Handle:hndl, CURL_OnSend:send_callback, CURL_OnReceiv
* @ param SendRecv_Act act The SendRecv_Act action after the singal
* @ return bool 1 on success. 0 = not a curl_easy_send_recv() curl, or not running/waiting
*/
native bool:curl_send_recv_Signal(Handle:hndl, SendRecv_Act:act);
native bool curl_send_recv_Signal(Handle hndl, SendRecv_Act act);
/**
* Check send & receive curl handle is Waiting or not
* @ param Handle hndl The handle of the send & receive curl to be used.
* @ return bool 1 = is waiting. 0 = not a curl_easy_send_recv() curl, or not running/waiting
*/
native bool:curl_send_recv_IsWaiting(Handle:hndl);
native bool curl_send_recv_IsWaiting(Handle hndl);
/**
* Send the send buffer for send & receive curl handle
......@@ -351,7 +351,7 @@ native bool:curl_send_recv_IsWaiting(Handle:hndl);
* @ param cell_t size if specified the \0 terminator will not be included
* @ noreturn
*/
native curl_set_send_buffer(Handle:hndl, const String:data[], size=-1);
native void curl_set_send_buffer(Handle hndl, const char[] data, int size=-1);
/**
* Send the receive data size for send & receive curl handle
......@@ -359,7 +359,7 @@ native curl_set_send_buffer(Handle:hndl, const String:data[], size=-1);
* @ param cell_t size The receive size
* @ noreturn
*/
native curl_set_receive_size(Handle:hndl, size);
native void curl_set_receive_size(Handle hndl, int size);
/**
* Set send timeout for curl_easy_send_recv()
......@@ -367,7 +367,7 @@ native curl_set_receive_size(Handle:hndl, size);
* @ param cell_t timeout How long will try to send data before it timeout (milliseconds).
* @ noreturn
*/
native curl_set_send_timeout(Handle:hndl, timeout);
native void curl_set_send_timeout(Handle hndl, int timeout);
/**
* Set receive timeout for curl_easy_send_recv()
......@@ -375,7 +375,7 @@ native curl_set_send_timeout(Handle:hndl, timeout);
* @ param cell_t timeout How long will try to receive data before it timeout (milliseconds).
* @ noreturn
*/
native curl_set_recv_timeout(Handle:hndl, timeout);
native void curl_set_recv_timeout(Handle hndl, int timeout);
/**
* Get CURLOPT_ERRORBUFFER error string in curl handle
......@@ -384,7 +384,7 @@ native curl_set_recv_timeout(Handle:hndl, timeout);
* @ param cell_t maxlen Destination buffer length (includes null terminator).
* @ noreturn
*/
native curl_get_error_buffer(Handle:hndl, String:buffer[], maxlen);
native void curl_get_error_buffer(Handle hndl, char[] buffer, int maxlen);
/**
* Extract information from a curl handle. (CURLINFO_STRING only)
......@@ -394,7 +394,7 @@ native curl_get_error_buffer(Handle:hndl, String:buffer[], maxlen);
* @ param cell_t maxlen Destination buffer length (includes null terminator).
* @ return The CURLcode code, see cURL_header.inc
*/
native CURLcode:curl_easy_getinfo_string(Handle:hndl, CURLINFO:info, String:buffer[], maxlen);
native CURLcode curl_easy_getinfo_string(Handle hndl, CURLINFO info, char[] buffer, int maxlen);
/**
* Extract information from a curl handle. (CURLINFO_LONG, CURLINFO_DOUBLE only)
......@@ -403,7 +403,7 @@ native CURLcode:curl_easy_getinfo_string(Handle:hndl, CURLINFO:info, String:buff
* @ param value Variable to store the value.
* @ return The CURLcode code, see cURL_header.inc
*/
native CURLcode:curl_easy_getinfo_int(Handle:hndl, CURLINFO:info, &any:value);
native CURLcode curl_easy_getinfo_int(Handle hndl, CURLINFO info, any &value);
/**
* URL encodes the given string
......@@ -413,7 +413,7 @@ native CURLcode:curl_easy_getinfo_int(Handle:hndl, CURLINFO:info, &any:value);
* @ param cell_t maxlen Destination buffer length (includes null terminator).
* @ return 1 on success.
*/
native bool:curl_easy_escape(Handle:hndl, const String:url[], String:buffer[], maxlen);
native bool curl_easy_escape(Handle hndl, const char[] url, char[] buffer, int maxlen);
/**
* URL decodes the given string
......@@ -423,7 +423,7 @@ native bool:curl_easy_escape(Handle:hndl, const String:url[], String:buffer[], m
* @ param cell_t maxlen Destination buffer length (includes null terminator).
* @ return The output length.
*/
native curl_easy_unescape(Handle:hndl, const String:url[], String:buffer[], maxlen);
native int curl_easy_unescape(Handle hndl, const char[] url, char[] buffer, int maxlen);
/**
* Return string describing error code
......@@ -432,7 +432,7 @@ native curl_easy_unescape(Handle:hndl, const String:url[], String:buffer[], maxl
* @ param cell_t maxlen Destination buffer length (includes null terminator).
* @ noreturn
*/
native curl_easy_strerror(CURLcode: code, String:buffer[], maxlen);
native void curl_easy_strerror(CURLcode code, char[] buffer, int maxlen);
/**
* Returns the libcurl version string
......@@ -440,7 +440,7 @@ native curl_easy_strerror(CURLcode: code, String:buffer[], maxlen);
* @ param cell_t maxlen Destination buffer length (includes null terminator).
* @ noreturn
*/
native curl_version(String:buffer[], maxlen);
native void curl_version(char[] buffer, int maxlen);
/**
* Returns the libcurl supported protocols string
......@@ -448,13 +448,13 @@ native curl_version(String:buffer[], maxlen);
* @ param cell_t maxlen Destination buffer length (includes null terminator).
* @ noreturn
*/
native curl_protocols(String:buffer[], maxlen);
native void curl_protocols(char[] buffer, int maxlen);
/**
* Returns the libcurl supported features
* @ return The currently features bits. see CURL_VERSION_*
*/
native curl_features();
native int curl_features();
/**
* This funcitopn same as Sourcemod OpenFile()
......@@ -472,7 +472,7 @@ native curl_features();
* @ param mode Open mode.
* @ return A Handle to the file, INVALID_HANDLE on open error.
*/
native Handle:curl_OpenFile(const String:file[], const String:mode[]);
native Handle curl_OpenFile(const char[] file, const char[] mode);
/**
......@@ -484,7 +484,7 @@ native Handle:curl_OpenFile(const String:file[], const String:mode[]);
*
* @ return A Handle to the curl_httppost, INVALID_HANDLE on error.
*/
native Handle:curl_httppost();
native Handle curl_httppost();
/**
* Add a section to a multipart/formdata HTTP POST
......@@ -495,7 +495,7 @@ native Handle:curl_httppost();
* @ param ... Variable number of format parameters.
* @ return The CURLFORMcode code, see cURL_header.inc
*/
native CURLFORMcode:curl_formadd(Handle:handl, any:...);
native CURLFORMcode curl_formadd(Handle handl, any ...);
/**
* Create a curl_slist struct
......@@ -514,7 +514,7 @@ native CURLFORMcode:curl_formadd(Handle:handl, any:...);
*
* @ return A Handle to the curl_slist, INVALID_HANDLE on error.
*/
native Handle:curl_slist();
native Handle curl_slist();
/**
* Add a string to an slist
......@@ -522,17 +522,17 @@ native Handle:curl_slist();
* @ param String buffer The string to add
* @ noreturn
*/
native curl_slist_append(Handle:hndl, const String:buffer[]);
native void curl_slist_append(Handle hndl, const char[] buffer);
/**
* Hash a file
* @ parma String file The file path. supports the "file://" notation.
* @ parma String file The file path. supports the "file //" notation.
* @ param Openssl_Hash algorithm Hash Algorithm.
* @ param Openssl_Hash_Complete complete_callback The complete callback.
* @ param cell_t value Value to set.
* @ noreturn
*/
native curl_hash_file(const String:file[], Openssl_Hash:algorithm, Openssl_Hash_Complete:complete_callback, any:value=0);
native void curl_hash_file(const char[] file, Openssl_Hash algorithm, Openssl_Hash_Complete complete_callback, any value=0);
/**
* Hash a string
......@@ -543,14 +543,13 @@ native curl_hash_file(const String:file[], Openssl_Hash:algorithm, Openssl_Hash_
* @ param cell_t maxlen Destination buffer length (includes null terminator).
* @ return 1 on success
*/
native bool:curl_hash_string(const String:input[], dataSize, Openssl_Hash:algorithm, String:buffer[], maxlength);
native bool curl_hash_string(const char[] input, int dataSize, Openssl_Hash algorithm, char[] buffer, int maxlength);
/**
* Do not edit below this line!
*/
public Extension:__ext_curl =
{
public Extension __ext_curl = {
name = "curl",
file = "curl.ext",
#if defined AUTOLOAD_EXTENSIONS
......
......@@ -8,9 +8,9 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
set -euo pipefail
cd "$DIR/.."
SMlatest=$(wget https://sm.alliedmods.net/smdrop/1.9/sourcemod-latest-linux -q -O -)
SMlatest=$(wget https://sm.alliedmods.net/smdrop/1.11/sourcemod-latest-linux -q -O -)
SMurl="https://sm.alliedmods.net/smdrop/1.9/"
SMurl="https://sm.alliedmods.net/smdrop/1.11"
SMdownloadlatest=${SMurl}${SMlatest}
......
......@@ -4,16 +4,23 @@
{
"Version"
{
"Latest" "v0.2"
"Latest" "v0.3"
}
"Notes" "Small bugfix"
"Notes" "Built on SourceMod 1.11.0 (Server must have 1.10.0 or higher)"
"Notes" "Updated forked Socket extension (for SM 1.10.0 compatibility) https://github.com/JoinedSenses/sm-ext-socket"
"Notes" "Updated cURL include files for SM 1.10.0 https://github.com/JoinedSenses/SourceMod-IncludeLibrary/"
"Notes" "Some small bugfixes"
}
"Files"
{
"Plugin" "Path_Mod/addons/sourcemod/plugins/Lobby.smx"
"Plugin" "Path_Mod/addons/sourcemod/gamedata/core.games/custom/empireshudtext.txt"
"Plugin" "Path_Mod/addons/sourcemod/extensions/curl.ext.dll"
"Plugin" "Path_Mod/addons/sourcemod/extensions/curl.ext.so"
"Plugin" "Path_Mod/addons/sourcemod/extensions/socket.ext.dll"
"Plugin" "Path_Mod/addons/sourcemod/extensions/socket.ext.so"
"Source" "Path_Mod/addons/sourcemod/scripting/Lobby.sp"
"Source" "Path_Mod/addons/sourcemod/scripting/include/socket.inc"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment