Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 91cd67b

Browse files
authored
Merge pull request #131 from Ravid-A/master
Update To Sourcemod 1.11.0 6930
2 parents b137580 + cb66cf1 commit 91cd67b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2239
-318
lines changed

Deploy/SPCode_Beta.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ CreateDirectory "$APPDATA\spcodebeta\sourcepawn\errorfiles"
4646
CreateDirectory "$APPDATA\spcodebeta\sourcepawn\temp"
4747
CreateDirectory "$APPDATA\spcodebeta\sourcepawn\templates"
4848
CreateDirectory "$APPDATA\spcodebeta\sourcepawn\configs"
49-
CreateDirectory "$APPDATA\spcodebeta\sourcepawn\configs\sm_1_10_0_6509"
49+
CreateDirectory "$APPDATA\spcodebeta\sourcepawn\configs\sm_1_11_0_6930"
5050

5151
SetOutPath $APPDATA\spcodebeta
5252
File /r ".\sourcepawn"

Deploy/SPCode_Stable.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ CreateDirectory "$APPDATA\spcode\sourcepawn\errorfiles"
4646
CreateDirectory "$APPDATA\spcode\sourcepawn\temp"
4747
CreateDirectory "$APPDATA\spcode\sourcepawn\templates"
4848
CreateDirectory "$APPDATA\spcode\sourcepawn\configs"
49-
CreateDirectory "$APPDATA\spcode\sourcepawn\configs\sm_1_10_0_6509"
49+
CreateDirectory "$APPDATA\spcode\sourcepawn\configs\sm_1_11_0_6930"
5050

5151
SetOutPath $APPDATA\spcode
5252
File /r ".\sourcepawn"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<Configurations>
2-
<Config Name="Standard SM 1.10.0.6509" SMDirectory="" Standard="1" CopyDirectory="" AutoCopy="0" ServerFile="" ServerArgs="" PostCmd="" PreCmd="" OptimizationLevel="2" VerboseLevel="1" DeleteAfterCopy="0" FTPHost="ftp://localhost/" FTPUser="" FTPPassword="" FTPDir="" RConSourceEngine="1" RConIP="127.0.0.1" RConPort="27015" RConPassword="" RConCommands="" />
2+
<Config Name="Standard SM 1.11.0.6930" SMDirectory="" Standard="1" CopyDirectory="" AutoCopy="0" ServerFile="" ServerArgs="" PostCmd="" PreCmd="" OptimizationLevel="2" VerboseLevel="1" DeleteAfterCopy="0" FTPHost="ftp://localhost/" FTPUser="" FTPPassword="" FTPDir="" RConSourceEngine="1" RConIP="127.0.0.1" RConPort="27015" RConPassword="" RConCommands="" />
33
</Configurations>

Resources/Misc/Configurations/sm_1_10_0_6509/include/geoip.inc

Lines changed: 0 additions & 102 deletions
This file was deleted.
-418 KB
Binary file not shown.

Resources/Misc/Configurations/sm_1_10_0_6509/include/admin.inc renamed to Resources/Misc/Configurations/sm_1_11_0_6930/include/admin.inc

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,20 @@ methodmap AdminId {
191191
// @param enabled True to enable, false to disable.
192192
public native void SetFlag(AdminFlag flag, bool enabled);
193193

194+
// Sets multiple bitwise flags to be enabled/disabled on an admin.
195+
//
196+
// @param flags Bitwise admin flags (ADMFLAG_*).
197+
// @param enabled True to set the flag, false to unset/disable.
198+
public void SetBitFlags(int flags, bool enabled)
199+
{
200+
AdminFlag flagArray[AdminFlags_TOTAL];
201+
int num = FlagBitsToArray(flags, flagArray, sizeof(flagArray));
202+
for (int i = 0; i < num; i++)
203+
{
204+
this.SetFlag(flagArray[i], enabled);
205+
}
206+
}
207+
194208
// Returns whether or not a flag is enabled on an admin.
195209
//
196210
// @param flag Admin flag to use.
@@ -278,6 +292,20 @@ methodmap GroupId {
278292
// @param enabled True to set the flag, false to unset/disable.
279293
public native void SetFlag(AdminFlag flag, bool enabled);
280294

295+
// Adds or removes multiple bitwise flags from a group's flag set.
296+
//
297+
// @param flags Bitwise admin flags (ADMFLAG_*).
298+
// @param enabled True to set the flag, false to unset/disable.
299+
public void SetBitFlags(int flags, bool enabled)
300+
{
301+
AdminFlag flagArray[AdminFlags_TOTAL];
302+
int num = FlagBitsToArray(flags, flagArray, sizeof(flagArray));
303+
for (int i = 0; i < num; i++)
304+
{
305+
this.SetFlag(flagArray[i], enabled);
306+
}
307+
}
308+
281309
// Returns the flag set that is added to users from this group.
282310
//
283311
// @return Bitstring containing the flags enabled.
@@ -773,3 +801,32 @@ stock bool BitToFlag(int bit, AdminFlag &flag)
773801

774802
return false;
775803
}
804+
805+
/**
806+
* Converts a bit string to a string of flag characters.
807+
*
808+
* @param bits Bit string containing the flags.
809+
* @param flags Output array to write a string of flag characters.
810+
* @param maxSize Maximum size of the string array.
811+
* @return Number of flag characters written.
812+
*/
813+
stock int FlagBitsToString(const int bits, char[] flags, const int maxSize)
814+
{
815+
AdminFlag array[AdminFlags_TOTAL];
816+
int numFlags = FlagBitsToArray(bits, array, AdminFlags_TOTAL);
817+
if (numFlags > maxSize)
818+
{
819+
numFlags = maxSize;
820+
}
821+
int i, c, numId = 0;
822+
for (i = 0; i < numFlags; ++i)
823+
{
824+
if(FindFlagChar(array[i], c))
825+
{
826+
flags[numId++] = c;
827+
}
828+
}
829+
flags[numId] = '\0';
830+
831+
return numId;
832+
}

Resources/Misc/Configurations/sm_1_10_0_6509/include/adminmenu.inc renamed to Resources/Misc/Configurations/sm_1_11_0_6930/include/adminmenu.inc

File renamed without changes.

Resources/Misc/Configurations/sm_1_10_0_6509/include/adt.inc renamed to Resources/Misc/Configurations/sm_1_11_0_6930/include/adt.inc

File renamed without changes.

Resources/Misc/Configurations/sm_1_10_0_6509/include/adt_array.inc renamed to Resources/Misc/Configurations/sm_1_11_0_6930/include/adt_array.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ methodmap ArrayList < Handle {
159159
// @param value String value to set.
160160
// @return Number of characters copied.
161161
// @error Invalid index.
162-
public native void SetString(int index, const char[] value);
162+
public native int SetString(int index, const char[] value);
163163

164164
// Sets an array of cells in an array.
165165
//
@@ -169,7 +169,7 @@ methodmap ArrayList < Handle {
169169
// blocksize. Otherwise, the size passed is used.
170170
// @return Number of cells copied.
171171
// @error Invalid index.
172-
public native void SetArray(int index, const any[] values, int size=-1);
172+
public native int SetArray(int index, const any[] values, int size=-1);
173173

174174
// Shifts an array up. All array contents after and including the given
175175
// index are shifted up by one, and the given index is then "free."

Resources/Misc/Configurations/sm_1_10_0_6509/include/adt_stack.inc renamed to Resources/Misc/Configurations/sm_1_11_0_6930/include/adt_stack.inc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ methodmap ArrayStack < Handle
5454
// new Array[X][32]
5555
public native ArrayStack(int blocksize=1);
5656

57+
// Clears a stack of all entries.
58+
public native void Clear();
59+
60+
// Clones an stack, returning a new handle with the same size and data.
61+
// This should NOT be confused with CloneHandle. This is a completely new
62+
// handle with the same data but no relation to the original. It should
63+
// closed when no longer needed.
64+
//
65+
// @return New handle to the cloned stack object
66+
public native ArrayStack Clone();
67+
5768
// Pushes a value onto the end of the stack, adding a new index.
5869
//
5970
// This may safely be used even if the stack has a blocksize
@@ -84,15 +95,15 @@ methodmap ArrayStack < Handle
8495
// @param block Optionally specify which block to read from
8596
// (useful if the blocksize > 0).
8697
// @param asChar Optionally read as a byte instead of a cell.
87-
// @return True on success, false if the stack is empty.
98+
// @return Value popped from the stack.
8899
// @error The stack is empty.
89100
public native any Pop(int block=0, bool asChar=false);
90101

91102
// Pops a string value from a stack.
92103
//
93104
// @param buffer Buffer to store string.
94105
// @param maxlength Maximum size of the buffer.
95-
// @oaram written Number of characters written to buffer, not including
106+
// @param written Number of characters written to buffer, not including
96107
// the null terminator.
97108
// @error The stack is empty.
98109
public native void PopString(char[] buffer, int maxlength, int &written = 0);

0 commit comments

Comments
 (0)