April 27, 2024, 05:26:49 pm

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - stormeus

Pages: 1 ... 6 7 [8] 9
106
VC:MP General / Introducting the VC:MP Developers' Blog
« on: January 22, 2012, 04:59:36 pm »
Apparently max linked the backup blog I made to the Development tab on the VC:MP home page. Pretty cool shiz.
http://vcmpdev.wordpress.com

107
Off Topic / Megaupload, Mega network shut down by FBI
« on: January 19, 2012, 10:10:20 pm »
http://www.nytimes.com/2012/01/20/technology/indictment-charges-megaupload-site-with-piracy.html?_r=1
http://www.bbc.co.uk/news/technology-16642369

And the day after the SOPA strike. The U.S. Department of Commerce still thinks we don't have the "appropriate tools" to take down pirates, and they seize an entire file-sharing network, again. LimeWire, anyone? :-\

108
Script Showroom / [REL] Stormeus' Extensible Scripts
« on: January 07, 2012, 06:32:42 am »
As usual, I got bored one night and came up with an interesting concept. Instead of having to edit various functions and files to add code you found or to write in a new, complex feature, you can hook and include files to add functionality.

Stormeus' Extensible Scripts (SES) has two types of "objects" (which is just stuff it can load):
  • Includes
  • Hooks

Includes are useful for adding functions that can be used by any other hooks or includes. They should contain functions, such as getting the speed of a vehicle.

Hooks add functionality to an event, like onServerStart or onPlayerMove. Instead of having to manually edit these functions in whatever file they may be, you can hook them by adding a line to an XML file.

A typical SES XML file will look like this:
Code: (Configuration/SES.xml) [Select]
<ses>
    <hook>DemoHook</hook>
    <hook>BasicAnticheat</hook>
    <hook>JoinMessages</hook>

    <include>GetVehicleVelocity</include>
</ses>

Includes are regular Squirrel files. However, hook files are different. If a function named SES_Init() is found in a hook file, it will be called. You can then use different hooking functions, like hook_onServerStart( functionPointer ), to add functionality to a server. Not only that, but each hook function will return an ID which can be used to unhook later. For example:

Code: (Hooks/Demo.nut) [Select]
function myOnServerStart() { print( "good" ); }

function SES_Init()
{
    local hookID = hook_onServerStart( myOnServerStart );

    if( hooked_onServerStart( hookID ) )
        unhook_onServerStart( hookID );
}

Download
http://stormeus.vicelegends.com/ses.zip


109
VC:MP General / Hello
« on: December 31, 2011, 05:21:55 pm »

110
Player Discussion / Strummus
« on: December 27, 2011, 01:02:09 am »
WHAT U THINK TO I

111
Off Topic / Disk Fragmentation
« on: December 19, 2011, 11:29:21 pm »
So have any of you guys seen fragmentation this bad?



This is on a server rig, so disk space is very modest since it's sharing a triple-boot with XP, Arch Linux, and Stormlinux.

ITT: Disk fragmentation

112
Off Topic / Stormlinux
« on: November 26, 2011, 09:45:35 pm »
EY YO MANGS WHAT YOU THINK
IT BOOTS IN 5 SEGUNDOS


113
Off Topic / I have a fan
« on: November 25, 2011, 07:54:09 pm »

114
Scripting Support / [Benchmark] SQLite vs INI
« on: November 23, 2011, 10:07:08 pm »
SQLite vs. INI: Read, Write, and Read/Write/Read
This test consists of three tests measuring the speed of SQLite's and INI files' read speeds, write speeds, and read/write/read speeds.

Read
Test consists of reading 1,000 records, printing the value of each record as it's read.
INI:
Quote
1 = a
2 = a
3 = a{...}


SQLite:
Quote
one | two
----|----
1   | a
2   | a
3   | a{...}

Write
Consists of writing 1,000 records in the same format as above.

Read/Write/Read
Reads each of the 1,000 records, prints the value of the record, overwrites it with "b", and prints the new value. (SQLite transactions are not used as it is a single query, and not a group)

Read
SQLite
INI


Quote
function onScriptLoad()
{
   LoadModule( "sq_lite" );
   local i, checkpoint, sql;
   checkpoint = GetTickCount();
   sql = ConnectSQL( "a.sql" );
   
   for( i = 1; i <= 1000; i++ )
   {
      local res = QuerySQL( sql, "SELECT two FROM a WHERE one = " + i );
      print( i + " = " + GetSQLColumnData( res, 0 ) );
      
      FreeSQLQuery( res );
   }
   
   local timeTaken = GetTickCount() - checkpoint;
   print( timeTaken + " ticks." );
}
Quote
function onScriptLoad()
{
   LoadModule( "sq_ini" );
   local i, checkpoint;
   checkpoint = GetTickCount();
   
   for( i = 1; i <= 1000; i++ )
      print( i + " = " + ReadIniString( "a.ini", "a", i.tostring() ) );
   
   local timeTaken = GetTickCount() - checkpoint;
   print( timeTaken + " ticks." );
}


Time: 1,514 ticksTime: 6,892 ticks

Write
SQLite
INI


Quote
function onScriptLoad()
{
   LoadModule( "sq_lite" );
   local i, checkpoint, sql;
   checkpoint = GetTickCount();
   sql = ConnectSQL( "a.sql" );
   
   QuerySQL( sql, "CREATE TABLE a ( one INTEGER, two TEXT )" );
   QuerySQL( sql, "BEGIN TRANSACTION" );
   for( i = 1; i <= 1000; i++ )
   {
      QuerySQL( sql, "INSERT INTO a VALUES ( " + i + ", 'a' )" );
   }
   QuerySQL( sql, "END TRANSACTION" );
   
   local timeTaken = GetTickCount() - checkpoint;
   print( timeTaken + " ticks." );
}
Quote
function onScriptLoad()
{
   LoadModule( "sq_ini" );
   local i, checkpoint;
   checkpoint = GetTickCount();
   
   for( i = 1; i <= 1000; i++ )
      WriteIniString( "a.ini", "a", i.tostring(), "a" );
   
   local timeTaken = GetTickCount() - checkpoint;
   print( timeTaken + " ticks." );
}


Time: 287 ticksTime: 11,481 ticks

Read/Write/Read
SQLite
INI


Quote
function onScriptLoad()
{
   LoadModule( "sq_lite" );
   local i, checkpoint, sql;
   checkpoint = GetTickCount();
   sql = ConnectSQL( "a.sql" );
   
   for( i = 1; i <= 1000; i++ )
   {
      local res = QuerySQL( sql, "SELECT two FROM a WHERE one = " + i );
      print( i + " = " + GetSQLColumnData( res, 0 ) );
      FreeSQLQuery( res );
      
      QuerySQL( sql, "UPDATE a SET two = 'b' WHERE a = " + i );
      
      res = QuerySQL( sql, "SELECT two FROM a WHERE one = " + i );
      print( i + " = " + GetSQLColumnData( res, 0 ) );
      FreeSQLQuery( res );
   }
   
   local timeTaken = GetTickCount() - checkpoint;
   print( timeTaken + " ticks." );
}
Quote
function onScriptLoad()
{
   LoadModule( "sq_ini" );
   local i, checkpoint;
   checkpoint = GetTickCount();
   
   for( i = 1; i <= 1000; i++ )
   {
      print( i + " = " + ReadIniString( "a.ini", "a", i.tostring() ) );
      WriteIniString( "a.ini", "a", i.tostring(), "b" );
      print( i + " = " + ReadIniString( "a.ini", "a", i.tostring() ) );
   }
   
   local timeTaken = GetTickCount() - checkpoint;
   print( timeTaken + " ticks." );
}


Time: 264,316 ticksTime: 29,800 ticks

Conclusion
SQLite is excellent for reading and writing long chains of data or single pieces of data, but fails when expected to write without using transactions. INIs are slower when reading and writing long chains of data, but performed better than SQLite when expected to read, write, and read again.

Because transactions could not have been used, the performance of SQLite was hindered by that and because SQLite had to check the integrity of each entry as it was written. INIs are efficient for that purpose, but because of how specific the situation was, I'm concluding that SQLite is better than using INIs in overall performance, and can perform even faster if I/O synchronization was disabled (which can corrupt data if power is lost or the server crashes).

115
Script Showroom / [Module] MySQL
« on: November 19, 2011, 06:22:31 am »
MySQL ( lu_mysql )

This is a re-release of Juppi's lu_mysql module, which was never formally released. The module would allow you to connect to any MySQL database on any server, unlike SQLite, which restricts you to databases in the server folder. This module can allow you to update stats on a website, while maintaining another database on your server.

The only difference between this and Juppi's original code is a courtesy loading message, two more exceptions for connection failures, and it's been recompiled to work properly. The original module seemed to not compile correctly, and trying to use it would always result in a "Failed to retrieve UserData"

All the credit should go to Juppi for coding the vast majority of this great module. The list of functions provided are:
  • mysql_connect( szHost, szUsername, szPassword, szDatabase, iPort )
  • mysql_close( pConnection )
  • mysql_query( pConnection, szQuery )
  • mysql_num_rows( pResult )
  • mysql_num_fields( pResult )
  • mysql_fetch_row( pResult )
  • mysql_fetch_assoc( pResult )
  • mysql_fetch_lengths( pResult )
  • mysql_free_result( pResult )
  • mysql_errno( pConnection )
  • mysql_error( pConnection )
  • mysql_ping( pConnection )
  • mysql_escape_string( pConnection, szString )
  • mysql_select_db( pConnection, szDatabase )
  • mysql_change_user( pConnection, szUser, szPassword )
  • mysql_warning_count( pConnection )
  • mysql_affected_rows( pConnection )
  • mysql_insert_id( pConnection )
  • mysql_info( pConnection )

And will be available on the (LU) wiki ASAP.

Installation
Extract lu_mysql.dll/so to your Modules folder, and libmysql.dll to the same folder as the server (if you're using Windows). Load the module and you should be good to go.

Download
Windows Binary
Linux Binary
Source Code

116
Script Showroom / [Module] mod_password
« on: November 17, 2011, 12:35:23 am »
Ctrl + V from LU and VC:MP Squirrel forums.

Quote
Password Strength Check Module ( mod_password )

A quick module I wrote from the Global Watchlist source code, this module connects to Google's password rating API to rate a password's strength. It's very simple, and consists of only one function.

int GetPasswordStrength( string password, [bool ignoreLength [, string userName]] )
password     - The password, as a string
ignoreLength - If true, password length is not checked. (Optional and false by default.)
userName     - The username, which can be used for additional security checks. (Optional)

The function returns an integer from 0-4, or null if an error occurs. The ratings are as follows:
  • 0 - Too short.
  • 1 - Insecure.
  • 2 - Okay.
  • 3 - Good.
  • 4 - Excellent.

Download (revision 2)
Combined Package (Linux, Source, and Windows in one ZIP)

Quote
Archive
Revision 1
Combined Package (Linux, Source, and Windows in one ZIP)

117
Script Showroom / [Squirrel] STORM256 Encryption
« on: November 11, 2011, 06:25:58 pm »
Something I've already posted on the VC:MP Squirrel forum, might as well repost it here. It works like MD5/SHA1 in lu_hashing, but is a slightly modified implementation of SHA256, which is more complex but also more secure. The fact that it's modified means it's even less likely someone is going to decrypt it.

Not for Pawn; if you're still using that,


Code: (Squirrel) [Select]
function rotateRight(val, sbits)
{
return (val >> sbits) | (val << (0x20 - sbits));
}
function STORM256( string )
{
local hp = [
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
];

local k = [
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
];

local
w          = array( 64 ),
i          = 0,
s          = 0,
len        = string.len( ),
word_array = array( 0 );

for( i = 0; i < len - 3; i += 4 )
{
word_array.push( string[i] << 0x18 | string[i + 1] << 0x10 | string[i + 2] << 0x08 | string[i + 3] );
}

switch( len % 4 )
{
case 0:
i = 0x80000000;
break;
case 1:
i = string[len - 1] << 0x18 | 0x80000000;
break;
case 2:
i = string[len - 2] << 0x18 | string[len - 1] << 0x10 | 0x08000;
break;
case 3:
i = string[len - 3] << 0x18 | string[len - 2] << 0x10 | string[len - 1] << 0x08 | 0x80;
break;
}
word_array.push( i );

while( ( word_array.len() % 0x10 ) != 0x0E )
word_array.push( 0 );

word_array.push( len >> 0x10 );
word_array.push( ( len << 0x03 ) & 0xFFFFFFFF );

local s0, s1;
for( s = 0; s < word_array.len(); s += 0x10 )
{
for( i = 0x00; i < 0x10; i++ )
w[i] = word_array[s + i];

for( i = 0x10; i < 0x40; i++ )
{
s0   = rotateRight( w[i - 15], 7 ) ^ rotateRight( w[i - 15], 18 ) ^ ( w[i - 15] >> 3 );
s1   = rotateRight( w[i - 2], 17 ) ^ rotateRight( w[i - 2], 19 ) ^ ( w[i - 2] >> 10 );
w[i] = w[i - 0x10] + s0 + w[i - 7] + s1;
}

local a = hp[0],
      b = hp[1],
      c = hp[2],
      d = hp[3],
      e = hp[4],
      f = hp[5],
      g = hp[6],
      h = hp[7];

for( i = 0x00; i < 0x40; i++ )
{
s0        = ( rotateRight( a, 2 ) ^ rotateRight( a, 13 ) ^ rotateRight( a, 22 ) );
local maj = ( ( a & b ) ^ ( a & c ) ^ ( b & c ) );
local t2  = ( s0 + maj );
s1        = ( rotateRight( e, 6 ) ^ rotateRight( e, 11) ^ rotateRight( e, 25 ) );
local ch  = ( ( e & f ) ^ ( ( ~e ) & g ) );
local t1  = ( h + s1 + ch + k[i] + w[i] );

h = g;
g = f;
f = e;
e = d + t1;
d = c;
c = b;
b = a;
a = t1 + t2;
}

hp[0] += a;
hp[1] += b;
hp[2] += c;
hp[3] += d;
hp[4] += e;
hp[5] += f;
hp[6] += g;
hp[7] += h;
}

local hash = format(
"%08x%08x%08x%08x%08x%08x%08x%08x",
hp[0],
hp[1],
hp[2],
hp[3],
hp[4],
hp[5],
hp[6],
hp[7]
);

return hash;
}

118
Script Showroom / Squirrel Server, Sans Death Messages
« on: September 30, 2011, 02:08:57 am »
Holy crap, a new version here

Quote
Boring Story
I cracked open the VC:MP Squirrel Server in a debugger and started looking through it. There was some interesting stuff (SendSpikeStrip and onPlayerCrashDump, for example) and found where the death messages are. I figured it would be useful to have a server that didn't FORCE the "X killed Y" messages.

After an hour of reading about assembly and jumping between addresses, I found the address that sent the messages (0040BAE0). I null'ed it (NOP) so it would not send a message. onPlayerDeath, onPlayerKill, and onPlayerTeamKill will work and the death will still be logged in the console.

Somewhat Tested
All messages are confirmed as nullified and will not be sent. However, the server callbacks still get thrown and the dead player will show up as dead to everyone else.

I have no idea what other effects this might have on the server, if any, so I wouldn't recommend using this on a production server just yet.

Actually Important Stuff
It's the same as the VC:MP Squirrel server, except it won't show the "X killed Y" or "X died" messages. Those are basically customizable by scripts now. This is not for Pawn.

Download
A Linux version is not available. Source code is not available, as it was hacked by using a debugger.
Windows server

119
Accepted Applications / Application - Stormeus
« on: July 25, 2011, 09:16:30 am »
Which game are you applying for, VC:MP, SA:MP, LU or all?: VC:MP

Nick: Stormeus

Previous Nicks: [IT]Stormeus

Timezone/Country: GMT -4 / USA

Age: 14

Do you speak English? Native language

Time you have played vcmp/samp: Four and a half months

Previous clans: IT - Disbanded

Do you use mIRC: X-Chat, basically the same

Why you want to join VU: I know a lot of VU members and I look up to their skill and attitude, so I want to join them.

Favourite weapon: Stubby, M4

Which VUs do you know: aXXo, Veteran, Bass, Verz, ferrari32, brian, Zeke, Cutton, acquainted with Thijn

Would you be interested in competing in clan wars?: Yes. Competed in ViceWars too.

120
Daily Register / Friday, June 3rd, 2009
« on: June 03, 2011, 11:21:39 pm »
So, uh... hey guys.

Pages: 1 ... 6 7 [8] 9