SourcePlugins Index SourcePlugins
All Plugins for Valve's Source - Hosted by Mattie
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Board Navigation
Home
Forum
Search

Plugins:
All Plugins
Mattie's Plugins

Web Tools:
VDF Creator

Randomness:
Flash game for CS:S
ThinkGeek PC Mods ThinkGeek Computing

Browse Source Plugins
[View all]
access(1) admin(7) anti-camp(3) anti-cheat(2) chat(2) clan(1) database(1) deathmatch(3) dods(2) international(1) leveling(1) lite(3) management(1) map-management(3) metamod(10) metaplugin(3) mod(3) models(1) perspective(1) players(1) popular(9) punishment(1) respawn(3) rpg(1) scheduling(1) scripting(4) sounds(6) source-code(4) special-effects(1) stats(3) user:McFly(1) war(1) weapons(5) web(1) zombie(1)

Who is Online

In total there are 3 users online :: 0 Registered, 0 Hidden and 3 Guests

Registered Users: None

[ View complete list ]


Most users ever online was 62 on Mon Jun 08, 2009 5:04 am


Search

Advanced Search

[26/7/07] SourceUtils v1.6
  Description: Utils For All Source Games!
  Tags: scripting database
Goto page 1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    SourcePlugins Index -> Plugins and Addons List
View previous topic :: View next topic  
Author Message
sn4k3
Regular


Joined: 10 Sep 2005
Posts: 178
Location: Portugal

PostPosted: Tue Jan 23, 2007 4:50 pm    Post subject: [26/7/07] SourceUtils v1.6 Reply with quote

SouceUtils:

This is my 1º plugin (c++), is small for now but i have some plans for the future.
SourceUtils work in all Source games win32/linux.
This is ONLY Utils.




############################################################################
########################Source Utils Commands###############################
############################################################################


su_Mysql

su_MySQL <ServerIP> <Port | 3306 = Default Port> <UserName> <Password | "" = No Password> <"DataBase | "" = No db Command"> <"Cmd"> [Var]

eg. su_mysql localhost 3306 root mypass "" "SELECT CURTIME()" time

NOTE: 'Var' is only for store a stat from one db using "SELECT" String


su_MySQLCreate

su_MySQLCreate <Connection Name> <Access Password> <ServerIP> <Port | 3306 = Default Port> <UserName> <Password | "" = No Password>

eg. su_mysqlcreate myconn myconnpass localhost 3306 root ""

NOTE: <Access Password> Is used for Edit|Delete|Use|Debug Yours Fast Connections


su_MySQLDelete

su_MySQLDelete <Connection Name> <Access Password>

eg. su_mysqldelete myconn myconnpass = Will Delete Your Connection
eg. su_mysqldelete myconn myfalseconnpass = "SU: Incorrect Access Password 'myfalseconnpass' For Connection 'myconn'!."
eg. su_mysqldelete myfalseconn myfalseconnpass = "SU: Connection 'myfalseconn' No Exists!. Use 'su_MySQLCreate"


su_MySQLEdit

su_MySQLEdit <Connection Name> <Actual Access Password> <New Access Password> <ServerIP> <Port | 3306 = Default Port> <UserName> <Password | "" = No Password>
Use 'NULL' To Stay The Old Param

eg. su_mysqledit myconn myconnpass mynewconnpass NULL NULL NULL NULL
eg. su_mysqledit myconn myconnpass NULL NULL NULL newuser userpass


su_MySQLInfo

su_MySQLInfo <Connection Name> <Access Password> [Var]

eg. su_mysqlinfo myconn myconnpass
eg. su_mysqlinfo myconn myconnpass su_temp_get

Code:
*************************************************
Info:
(null) = Empty "" Argument On Param
 
Source Utils Fast Mysql Connection Info:
Connection Name: myconn
Access Password: myconnpass
 
Source Utils Fast Mysql Connection Data:
Ip: localhost
Port: 3306
Username: root
Password: (null)

*************************************************


su_temp_get = "myconn myconnpass || localhost 3306 root (null)"


su_MySQLFast

su_MySQLFast <Connection Name> <Access Password> <"DataBase | "" = No db Command"> <"Cmd"> [Var]

eg. su_mysqlfast myconn myconnpass "" "DROP DATABASE IF EXISTS `su_test`;CREATE DATABASE `su_test`"


su_AddDownload


su_AddDownload <path/filename.***>

eg. su_AddDownload sound/sn4k3/mymp3.mp3


su_GetExists

su_GetExists <Action> <Name> <Var>
<Action = (file | directory | userid | cvar | pause | mysqlfastconn | externalsrc | cmdtarget | mute | profile | mapent)>

eg. su_GetExists file cfg/server.cfg su_temp_get = will return 1
eg. su_GetExists directory addons su_temp_get = probaly return 1
eg. su_GetExists userid 10 su_temp_get
eg. su_GetExists cvar mycvar su_temp_get = return 0 if cvar not exists
eg. su_GetExists pause something su_temp_get = return 0 if not paused
eg. su_GetExists mysqlfastconn my_conn_name su_temp_get = return 0 if mysqlfastconn not exists/created
eg. su_GetExists externalsrc my_externalsrc_alias_name su_temp_get = return 0 if the externalsrc not exists/created
eg. su_GetExists cmdtarget -tickrate su_temp_get = return 0 if not exists that parm in cmdtarget
eg. su_GetExists mute userid su_temp_get = return 0 if not muted
eg. su_GetExists profile profile_name su_temp_get = return 0 if profile name not exists/created
eg. su_GetExists mapent buy_zone su_temp_get = return 0 if not exits that entity in map

su_Precache

su_Precache <sound | model> <path/filename> [Var]

eg. su_Precache model models/zombies/newzombie.mdl
eg. su_Precache model materials/zombies/newzombie.vtf (not need)
eg. su_Precache sound mp3/mymp3.mp3/wav su_temp_get

NOTE: [Var] = Return With Precached index

su_GetVersion

su_GetVersion <Host> <Port (80)> <Var>

eg. su_GetVersion mattie.info 80 su_temp_get = Will Return A Version Of ES
eg. es_msg Eventscripts Version: server_var(su_temp_get)
eg. return in chat == Eventscripts Version: 1.3.0.006


Good for know if plugin/script is outdate.


NOTE: You Need Put One File In Host With Name 'version.txt' After Put Version In 1º
Line eg. 1.0.5.0 After Save File And Send To FTP


su_Rand

su_Rand <Minimum> <Maximum> <Var>

eg. su_Rand 1 100 su_temp_get = rand a number between 1 and 100


su_CVarForceSet

su_CVarForceSet <Var> <Value> <Silence Set>
<Silence Set> = Dont Advert Var Change In Chat

eg. su_CVarForceSet sv_cheats 1 0 = will change sv_cheats to 1 and advert change in chat
eg. su_CVarForceSet sv_cheats 1 1 = will change sv_cheats to 1 and no change advert in chat

NOTE: Change only advert in chat if cvar is REPLICATED


EndRound:

su_EndRound

eg. su_EndRound = Will force end a round


su_GetTime

su_GetTime <Time Format> <Cvar>

<Time Format>:
'%d' = day
'%m' = month
'%Y' = Year
'%H' = Hour
'%M' = Minute
'%S' = Secounds
'%Z' = GMT()

eg. su_GetTime "%d/%m/%Y || %H-%M-S" su_temp_get = will return with "Day/Month/Year || Hours/Minutes/Secounds"


su_replace

su_replace <Var> <"Text"> <"New Text">

eg. su_temp_get "this is a test with replace"
eg. su_replace "a test" "a new test" = will return with 'this is a new test with replace'


su_ChangeLevel

su_ChangeLevel <LevelName>

eg. su_ChangeLevel de_dust2


su_profile

su_profile <Action (create | remove | reset | get)> <Alias> [Var]

eg. su_profile create my_profile_name = create a profile alias (auto start counting)
eg. su_profile reset my_profile_name su_temp_get = will reset time but first get alias profile time
eg. su_profile get my_profile_name su_temp_get = will get alias profile time and continue counting
eg. su_profile remove my_profile_name = will remove alias profile


su_Load

su_Load <Action (externalsrc)> <Alias> <Folder>
(externalsrc) Folder = '|root' To run ROOT Apps

eg. su_load externalsrc wget_cmd wget su_systempw


NOTE: Default <Folder> = addons/sourceutils/externalsrc '(su_externalsrc_folder) cvar'
NOTE: You need have the System PW for Load ExternalSRC (addons/sourceutils/sourceutils_security.cfg)


su_Load_Print

su_Load_Print

eg. su_load_print

Code:
Source Utils Loaded Scripts:
__________________________________________________________
Alias
1-> wget_cmd  (addons/sourceutils/externalsrc/wget)
__________________________________________________________



su_UnLoad

su_UnLoad <Action (externalsrc)> <Alias>

eg. su_unload externalsrc wget_cmd


su_ExternalSrc

su_ExternalSrc <Action (addlink | editlink | use | info)> <Alias> [Command]

eg. su_ExternalSrc addlink wget_cmd wget.exe = will add wget.exe to alias name for use
eg. su_ExternalSrc editlink wget_cmd wget.exe = will add/edit wget.exe to alias name for use
eg. su_ExternalSrc use wget_cmd "www.mattie.info/cs" = Will download the http target link


NOTE: Full info about this in: 'addons/sourceutils/externalsrc/Readme.txt'
Dangerous


su_Compile

su_Compile <Path/To/Configure/Sh>

eg. su_Compile addons/sourceutils/externalsrc/qstat

This will compile ONLY Linux Srcs (MakeFile) And (configure)
In compile finish will create a file saying finish trying the compile (not say compile un/success)


su_Log

su_Log <Text>

eg. su_log "A log text exemple from source utils"

NOTE: Only Print The text if Log mod Is ON (log on)


su_Sound

su_Sound <Action (getduration | stopall)> [Sound] [Var]

eg. su_Sound getduration radio/go.wav su_temp_get = will get .wav file sound duration
eg. su_Sound stopall = will Stop all Played sounds

NOTE: <getduration> Only suport '.wav' Files !!


su_SConsole

su_SConsole get <Action (index | max | target | value | name)> <Parm Name> <Var>
su_SConsole set <Action (create | remove)> <Parm Name> <Value> <Access-Password> [Var]

eg. su_SConsole get index -tickrate su_temp_get = will return with parm index
eg. su_SConsole get max 0 su_temp_get = will return with Max parm Count
eg. su_SConsole get target 0 su_temp_get = will return with All parms in cmdtarget
eg. su_SConsole get value +map su_temp_get = will return with parm value eg. de_dust2
eg. su_SConsole get name <index eg. '5'> su_temp_get = will Get parm index name

Allowed Parms: (# ! $ | » >) 'su_avaliable_parms' cvar

eg. su_SConsole set create >my_parm hello mypassword su_temp_get = if have a cvar will return with the new parm index
eg. su_SConsole set remove >my_parm 0 mypassword


su_SQlite

su_SQlite <db> <Cmd>

eg. su_SQlite my_db "MY CMD"


su_GeoIP

su_GeoIP <Type (ip | http)> <By> <Ip/Http> <Var>
<By (0 = Country Code2 | 1 = Country Code3 | 2 = Country Name)>


eg. su_GeoIP ip 0 "208.167.248.24:27015" su_temp_get
"su_temp_get" = "US"

eg. su_GeoIP ip 1 "208.167.248.24:27015" su_temp_get
"su_temp_get" = "USA"

eg. su_GeoIP ip 3 "208.167.248.24:27015" su_temp_get
"su_temp_get" = "United States"

eg. su_GeoIP http 0 "www.mattie.info" su_temp_get
"su_temp_get" = "US"

eg. su_GeoIP http 3 "www.sourcemod.net" su_temp_get
"su_temp_get" = "United States"


NOTE: <Type (ip) ONLY || Ports ":" Are Auto Removed
NOTE: <type = http> use theard!! take a time to get result!


su_getnetinfo

su_getnetinfo <Action> <userid> <var>
<Action (ip | ping | choke | loss | packet | contime | timeout)>

eg. su_getnetinfo ip 10 su_temp_get
eg. su_getnetinfo ping 10 su_temp_get
eg. su_getnetinfo choke 10 su_temp_get
eg. su_getnetinfo loss 10 su_temp_get
eg. su_getnetinfo packet 10 su_temp_get
eg. su_getnetinfo contime 10 su_temp_get
eg. su_getnetinfo timeout 10 su_temp_get


NOTE: <Action (timeout)> return 0 or 1 (0/1)


su_mapfind

su_mapfind <name (* = all)>

eg. su_mapfind zm_
eg. su_mapfind de_
eg. su_mapfind *

NOTE: This only print founded results!


su_echo

su_Echo <Text To Print>

eg. su_echo Echo function writed in SourceUtils v1.6


NOTE: Not a Warpper From "echo" Command!


su_for

su_For <beginvalue> <endvalue> <command>

eg. su_for 0 100 "su_echo sending 100 commands to console"


su_File

su_file get <filename> <action (line | size)> [linenumber] <var>
su_file endwrite <filename> <text>
su_file event <filename> <remove comments (0 = no | 1 = yes)> [var]
su_file list <filetocreate.*> <search-path> [only file names (0 = fullpath to file)] [include others game folders (1 = yes)] [prefix-command] [remove .extension (1 = yes)]
su_file remove <file> [Full-Access-Password]

eg. su_file get mapcycle.txt line 10 su_temp_get = will get file line text!
eg. su_file get mapcycle.txt size 10 su_temp_get = will get file line text Size!
eg. su_file get mapcycle.txt size 0 su_temp_get = will get file size!
eg. su_File endwrite mapcycle.txt de_newmap = will add that map to mapclycle
eg. su_file event mapcycle.txt 1 su_temp_get = will debug all file lines, sizes, status
eg. su_file list mapcycle.txt maps/*.bsp 1 0 0 1 = will write to file all founded files with .bsp
eg. su_file list cfg/downloads.cfg sound/myscript/*.mp3 0 0 su_adddownload 0 = output (su_adddownload sound/myscript/sound.mp3)
eg. exec downloads = will add downloads in last created file!
eg. su_file remove myfile.txt su_filepw
eg. su_file remove su_myfile.txt


NOTE: [Full-Access-Password] Allow you remove any file!!! without this you only can remove files with su_ in name eg. su_myfile.cfg


su_FileCreate

su_FileCreate <Filename>

eg. su_FileCreate mynewfile.txt = will create a file named mynewfile.txt in cstrike folder!
eg. su_FileCreate cfg/mynewfile.txt = will create a file named mynewfile.txt in cstrike/cfg folder!

NOTE: You cant Replace a file!!!


su_dumpclassprops

su_dumpclassprops <print to (0 = Console | 1 = File)>
(File) OutPut: 'addons/sourceutils/dumps/su_dumpclassprops_mapname.txt'

eg. su_dumpclassprops 0 = will print all to console
eg. su_dumpclassprops 1 = will print all to file


su_dumpclassprops

su_dumpmapentitys <print to (0 = Console | 1 = File)>
(File) OutPut: 'addons/sourceutils/dumps/su_dumpmapentitys_mapname.txt'

eg. su_dumpmapentitys 0 = will print all to console
eg. su_dumpmapentitys 1 = will print all to file


su_dumpsclean

su_dumpsclean

eg. su_dumpsclean = will clean dumps folder


############################################################################
##########################Source Utils Events###############################
############################################################################

Event File: addons/sourceutils/sourceutils.res
Auto Loaded To EventScripts


Code:

"sourceutilsevents"
{
   "su_mysql"  // Used For Mysql (su_mysql | su_mysqlfast)
   {
      "su_mysql_userid"   "short"      // Set Your Query "SELECT" Userid. Retured By su_mysql* [Var]
      "su_mysql_status"   "short"         // 0 = Connection Fail | 1 = Query Fail | 2 = Sucessfull MySQL Job | 3 = Sucessfull MySQL Job With Returned Data
      "su_mysql_data"    "string"         // Return Data Selected (SELECT *) (0 = No Select Command | OK = Finish Get All Data)
      "su_mysql_db"      "string"      // db Used (0 = No db Used)
      "su_mysql_cmd"      "string"      // Cmd Used
   }
   "su_thread" // Used For Global Threaded Functions
   {
          "su_thread_userid"      "short"      // Set Your Query Userid. Retured By Function [Var]
          "su_thread_function"    "string"         // Function Used (geoip)
         "su_thread_data"        "string"       // If A Sucessfull Query Return Data If Not Return The Error
         "su_thread_status"      "short"        // 0 = Fail | 1 = Sucessfull
   }
   "su_file"  // Used For su_file event <filename> [var]
   {
          "su_file_userid"         "short"      // Set Your Query Userid. Retured By Function [Var]
          "su_file_line"       "string"       // Line Returned
         "su_file_size"           "short"          // If A Sucessfull Query Return Data If Not Return The Error
         "su_file_line_size"     "short"     // 0 = Fail | 1 = Sucessfull
         "su_file_status"        "short"     // 0 = Not Finish | 1 = Finish Debug
   }
}




############################################################################
##########################Source Utils CVars################################
############################################################################

su_temp_get = a temp cvar to get the returns.
su_version = show current source utils version.
su_os = show operative system type server is using (Windows | Linux)
su_maxplayers = show maxplayers server have
su_currentmap = show the current map
su_gamemod = show current game mod
su_lastcompile = show last compile date
su_tickrate = show server tickrate
su_externalsrc_folder = show externalsrc folder source utils is using
su_avaliable_parms = show avaliable parms to use in text begin (su_sconsole set create)
su_servergamedll = show gameserverdll source utils is using
su_tools_folder = Show Source Utils Tools Path
su_dedicatedserver = Is Dedicated Server? (0 = No/ 1 = Yes)
su_nextmap = Nextmap
su_backmap = BackMap
su_freelib_version = Source Utils FreeLib Version
su_freelib_license = Source Utils FreeLib License (GPL)



############################################################################
###########################Source Utils Docs################################
############################################################################


MySQL Client Syntax
Sqlite3 Client Syntax




ToDo:

In Target:

- Parser [.ini/.xml/.cfg]
- FTP
- http functions

They can post edias Smile

Special Thanks:

- chumly (Encorage-me to makeit [Objective MySQL])
- www.sourcemm.net (MetaMod Source Engine, Plugin Track)
- www.sourcemod.com (Thanks To all help From comunity, examples, Linux Problems Compile, Addons Stats Track and for the Plugin Annouce)
- www.sourceplugins.com (Thanks To all help From comunity and for the Plugin Annouce)
- www.hl2coding.com (Thanks for posted examples [Where i started learn c++ Smile])
- C0ld (thanks For crosstoll, Linux Compile tutorial |cygwin| And For MakeFile Template)
- Mattie (For www.sourceplugins.com Web Site And EventScripts For the Source Utils Usage)


Credits:

- sn4k3 (Developer)
- chumly MySQL "SELECT()" Rows Help, tester


Quote:

Changelog:

v1.6 [26/7/07]

- added SourceUtils FreeLib can run without SourceUtils bin files (only mysql functions)
- added 'su_thread' event for threaded functions like geoip http
- added 'su_file' event for debug/print a file
- added file open/endwrite/list/remove/event commands
- added su_echo command
- added su_getexists mapent (allow know if exists an entity in map eg. buy_zone)
- added su_for command
- added su_FileCreate command (allow you create your own files!)
- added su_dumpclassprops command
- added su_dumpmapentitys command
- added su_dumpsclean command
- added a new folder 'addons/sourceutils/dumps' for dumps

- added 'su_nextmap' cvar to know nextmap
- added 'su_backmap' cvar to know backmap

- updated GeoIp.dat
- updated sourceutils_security.cfg with Files Options

- Improved su_compile command!
- Improved su_cvarforceset command!

- fixed all userid problems (crashs, not found userid)
- fixed "su_getnetinfo timeout" no setvalue to 0
- fixed all "su_getexists" no setvalue to 0

v1.5 [2/6/07]

- added GeoIp Functions (http Theared only)
- added netinfo functions (allow get ip/ping/timeouts ...)
- added MapFind allow search maps on server
- added 'addons/sourceutils/tools' folder

- added 'su_tools_folder' cvar to know Source Utils Tools Path
- added 'su_dedicatedserver' cvar to know If Server Is Dedicated
- added 'su_freelib_version' cvar to know Source Utils FreeLib Version
- added 'su_freelib_license' cvar to know Source Utils FreeLib License (GPL)

- relesed SourceUtils FreeLib Source Code

- change all source utils bin/folder files
- change mysql userids increase type

- fixed bin files (linux)
- fixed mysql license (GPL)


v1.4 [14/5/07]

- added 'su_mysql_userid' to su_mysql event
- added 'addons/sourceutils/sourceutils_security.cfg' file
- added ExternalSRC security (root access, deny programs, master password)
- added 'su_load' [MasterPass] Parm
- changed su_mysql* [Var] = gets su_mysql_userid
- fixed linux binnary dont work

v1.3 [6/5/07]

- added su_getexists mysqlfastconn
- added su_getexists externalsrc
- added su_getexists cmdtarget
- added su_getexists mute
- added su_getexists profile
- added su_externalsrc (like system command)
- added su_profile (get a precision profile)
- added su_compile (allow compile (ONLY) linux makefiles)
- added su_log (can print mensages to current log file)
- added su_precache now suport get file index
- added su_load (allow load source utils extras)
- added su_unload (allow unload loaded scripts)
- added su_load_print (allow print loaded scripts)
- added su_sconsole get/set (allow get/set parms in server console cmd target)
- added su_sound (sound utils like get duration)
- added su_sqlite (allow make sqlite3 querys) (UNTESTED)
- added a Plugin load mensage (successfull load)

- added Source Utils Events! (addons/sourceutils/sourceutils.res)
- added event su_mysql
- added auto load for EventScripts Source Utils Events

- added 'su_tickrate' cvar to see server tickrate
- added 'su_externalsrc_folder' cvar to see ExternalSrc folder source utils is using
- added 'su_avaliable_parms' cvar know what parms can use in begin 'su_sconsole set create' (# ! $ | » >)
- added 'su_servergamedll' cvar to see what GameServerDll Source Utils is using
- added cvars callback (disallow source utils cvars change)

- added update metamod source library to v1.4

- fixed su_getexists userid can crash server if no player in server
- fixed MySQL Fast Connections dont use selected db

v1.2 [5/4/07]

- added MySQL compatible binnary querys!
- added MySQL Multi-Theard ( Now dont stop the server )
- added MySQL Suport "LOAD DATA INFILE"
- added MySQL Suport Multi Statments Separated by A ";"
- added MySQL Suport Multi Results
- added MySQL Fast Connections
- added MySQL Fast Create|Delete|Edit|Info Connections
- fixed Not need SQL.dll for work!

v1.1 [13/3/07]

- added 'su_temp_get' cvar to get things also they can use others cvars
- added 'su_currentmap' cvar to see current map
- added 'su_os' cvar to see Operating System (Windows | Linux)
- added 'su_maxplayers' cvar to see maxplayers/slots
- added 'su_gamemod' cvar to see Current Running DLL Game Mod
- added 'su_lastcompile' cvar to see last compile date of Source Utils


- add GetExists
- add AddDownload
- add Precache Model/Sound
- add Rand (Rand Numbers)
- add Version Check
- add Changelevel
- add CvarForceset
- add Force EndRound
- add GetTime
- add Replace (allow repace text)


- add Suport For MetaMod Source

- fixed 'su_version' cvar cant be Msg/Get Say Protected


v1.0 [23/1/07]

- first realse




Links:


Download SourceUtils MetaMod: Source Version (V1.6)
MetaMod:Source Home

Download SourceUtils Standart Alone Version (V1.6)
Standart Alone Version Home


Download SourceUtils FreeLib Source Code (V1.1)

NOTE:

if you need install soruceutils in other game than counter-strike source you need modificate (addons/sourceutils.vdf) !!!
eg. change 'cstrike' for 'dod'

OR

you can get you .vdf easy here: VDF Creator
In Plugin choose: SourceUtils
After choose you game server!

_________________
My Plugins:

SourceUtils
Sn4k3 Plugin Template (SPT) -> Make your own plugin. Already include some funcs.


Last edited by sn4k3 on Mon Sep 29, 2008 5:00 am; edited 17 times in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger



Mattie
Administrator
Administrator


Joined: 21 May 2005
Posts: 1875
Location: Fort Lauderdale, FL

PostPosted: Tue Jan 23, 2007 5:25 pm    Post subject: Reply with quote

Congrats, sn4k3!

Is the MySql access multi-threaded? So it doesn't stop the server while it waits for the SQL response?

Or should people only use it during times when they can afford to wait for a response?

Congrats on your plugin,
-Mattie
Back to top
View user's profile Send private message Visit poster's website
sn4k3
Regular


Joined: 10 Sep 2005
Posts: 178
Location: Portugal

PostPosted: Wed Jan 24, 2007 8:42 am    Post subject: Reply with quote

Mattie wrote:
Congrats, sn4k3!

Is the MySql access multi-threaded? So it doesn't stop the server while it waits for the SQL response?

Or should people only use it during times when they can afford to wait for a response?

Congrats on your plugin,
-Mattie


ty
i have make tests with invalid hosts Smile and server dont stop when in trying a fail connection

in next version i will imporve Mysql
but im a c++ beginner
for now im trying do a same effect of yours es_keysetvalue but for a begginer is very hard !

in future:

su_mysqlcreate myconnection localhost 3306 root ""
su_mysqlcmd myconnection "SELECT CURTIME()"
su_mysqlcmd myconnection "CREATE DATABASE `new`"

and some set commands

_________________
My Plugins:

SourceUtils
Sn4k3 Plugin Template (SPT) -> Make your own plugin. Already include some funcs.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Mattie
Administrator
Administrator


Joined: 21 May 2005
Posts: 1875
Location: Fort Lauderdale, FL

PostPosted: Wed Jan 24, 2007 1:19 pm    Post subject: Reply with quote

Quote:
and server dont stop when in trying a fail connection

I'm not talking about failed connections-- I'm talking about any connection.

Since you use EventScripts, try this in player_footstep (with eventscripts_noisy 1) with a bunch of bots and you'll probably see what I mean. Stopping the server for a remote SQL database connection is usually a bad idea.

If I recall correctly, Mani made his MySQL queries multi-threaded so they don't hold-up the server.

-Mattie
Back to top
View user's profile Send private message Visit poster's website
sn4k3
Regular


Joined: 10 Sep 2005
Posts: 178
Location: Portugal

PostPosted: Tue Mar 13, 2007 11:57 am    Post subject: Reply with quote

New Version of SU!

v1.1 [13/3/07]

- add 'su_temp_get' cvar to get things also they can use others cvars
- add 'su_currentmap' cvar to see current map
- add 'su_os' cvar to see Operating System (Windows | Linux)
- add 'su_maxplayers' cvar to see maxplayers/slots
- add 'su_gamemod' cvar to see Current Running DLL Game Mod
- add 'su_lastcompile' cvar to see last compile date of Source Utils


- add GetExists
- add AddDownload
- add Precache Model/Sound
- add Rand (Rand Numbers)
- add Version Check
- add Changelevel
- add CvarForceset
- add Force EndRound
- add GetTime
- add Replace (allow repace text)


- add Suport For MetaMod Source

- fixed 'su_version' cvar cant be Msg/Get Say Protected

_________________
My Plugins:

SourceUtils
Sn4k3 Plugin Template (SPT) -> Make your own plugin. Already include some funcs.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
bl1nk
New User


Joined: 22 Oct 2005
Posts: 2

PostPosted: Sun Mar 25, 2007 2:17 pm    Post subject: Reply with quote

I cant seem to get this mod to work with a windows server. Any ideas? Its not even loading.
Back to top
View user's profile Send private message
sn4k3
Regular


Joined: 10 Sep 2005
Posts: 178
Location: Portugal

PostPosted: Mon Mar 26, 2007 7:53 am    Post subject: Reply with quote

bl1nk wrote:
I cant seem to get this mod to work with a windows server. Any ideas? Its not even loading.


if server is not a css game you need change source_utils.vdf

_________________
My Plugins:

SourceUtils
Sn4k3 Plugin Template (SPT) -> Make your own plugin. Already include some funcs.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
sn4k3
Regular


Joined: 10 Sep 2005
Posts: 178
Location: Portugal

PostPosted: Thu Apr 05, 2007 5:15 pm    Post subject: Reply with quote

New Version!!

v1.2 [5/4/07]

- add MySQL compatible binnary querys!
- add MySQL Multi-Theard ( Now dont stop the server )
- add MySQL Suport "LOAD DATA INFILE"
- add MySQL Suport Multi Statments Separated by A ";"
- add MySQL Suport Multi Results
- add MySQL Fast Connections
- add MySQL Fast Create|Delete|Edit|Info Connections
- fixed Not need SQL.dll for work!

_________________
My Plugins:

SourceUtils
Sn4k3 Plugin Template (SPT) -> Make your own plugin. Already include some funcs.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Mattie
Administrator
Administrator


Joined: 21 May 2005
Posts: 1875
Location: Fort Lauderdale, FL

PostPosted: Sun Apr 08, 2007 8:03 pm    Post subject: Reply with quote

Wow, very cool update, Snake. I'll have to look at this some.

-Mattie
Back to top
View user's profile Send private message Visit poster's website
[NATO]Hunter
Reader


Joined: 26 Jul 2005
Posts: 75
Location: Germany, NRW, Oberhausen

PostPosted: Sat Apr 14, 2007 5:23 pm    Post subject: Reply with quote

Great work again, sn4k3, I am starting to like you Wink
_________________

Back to top
View user's profile Send private message Send e-mail Visit poster's website
Ethryx
New User


Joined: 14 Apr 2007
Posts: 2

PostPosted: Sat Apr 14, 2007 11:47 pm    Post subject: Reply with quote

I have a quick question about the latest release. I'm going to show my example along with EventScripts. Since this release introduces multi-threading, how would something like this work:

es_xsetinfo sqlresult 0
es su_mysql <host> <port> <usr> <pass> <db> "SELECT * FROM exampletable WHERE userid = 1" sqlresult
es es_xmsg result is: server_var(sqlresult)

This would normally work fine, and it did before the latest release. But now, the sqlresult variable is not filled with the results instantly (probably because of how sql uses a different thread now). How would I fix this coding to allow me to "wait" for the results to arrive then use the variable after that.
Back to top
View user's profile Send private message
sn4k3
Regular


Joined: 10 Sep 2005
Posts: 178
Location: Portugal

PostPosted: Sun Apr 15, 2007 3:41 pm    Post subject: Reply with quote

[NATO]Hunter wrote:
Great work again, sn4k3, I am starting to like you Wink


Razz thanks

Ethryx wrote:
I have a quick question about the latest release. I'm going to show my example along with EventScripts. Since this release introduces multi-threading, how would something like this work:

es_xsetinfo sqlresult 0
es su_mysql <host> <port> <usr> <pass> <db> "SELECT * FROM exampletable WHERE userid = 1" sqlresult
es es_xmsg result is: server_var(sqlresult)

This would normally work fine, and it did before the latest release. But now, the sqlresult variable is not filled with the results instantly (probably because of how sql uses a different thread now). How would I fix this coding to allow me to "wait" for the results to arrive then use the variable after that.


i not have computer now. i only can visit the sites in public computers.
i cant work now.
when i return for my computer i will see this

try use that syntax directly in server console/rcon and say the results here

_________________
My Plugins:

SourceUtils
Sn4k3 Plugin Template (SPT) -> Make your own plugin. Already include some funcs.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Ethryx
New User


Joined: 14 Apr 2007
Posts: 2

PostPosted: Sun Apr 15, 2007 7:33 pm    Post subject: Reply with quote

if I do it right into rcon/server console, it works exactly as it should. This is because there is a pause between running the query and printing the results (the time it takes to put each command in). if I run them in a script though, the time between each command being run by eventscripts is like 0.0000000001, and results aren't stored into the variable yet. So I was wondering if an event could be raised or something when sql results come back. Otherwise, you have to make a loop waiting for the results to come back which totally defeats the purpose of multithreading to stop server lag.
Back to top
View user's profile Send private message
sn4k3
Regular


Joined: 10 Sep 2005
Posts: 178
Location: Portugal

PostPosted: Mon Apr 16, 2007 3:24 am    Post subject: Reply with quote

Ethryx wrote:
if I do it right into rcon/server console, it works exactly as it should. This is because there is a pause between running the query and printing the results (the time it takes to put each command in). if I run them in a script though, the time between each command being run by eventscripts is like 0.0000000001, and results aren't stored into the variable yet. So I was wondering if an event could be raised or something when sql results come back. Otherwise, you have to make a loop waiting for the results to come back which totally defeats the purpose of multithreading to stop server lag.


try use es_xsoon

_________________
My Plugins:

SourceUtils
Sn4k3 Plugin Template (SPT) -> Make your own plugin. Already include some funcs.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
sn4k3
Regular


Joined: 10 Sep 2005
Posts: 178
Location: Portugal

PostPosted: Mon Apr 16, 2007 3:13 pm    Post subject: Reply with quote

you can post here full bug and decription

when i have my pc good again i will repair that

post console Error Msg too

_________________
My Plugins:

SourceUtils
Sn4k3 Plugin Template (SPT) -> Make your own plugin. Already include some funcs.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
sn4k3
Regular


Joined: 10 Sep 2005
Posts: 178
Location: Portugal

PostPosted: Sun May 06, 2007 2:05 pm    Post subject: Reply with quote

new Version!

v1.3 [6/5/07]

- added su_getexists mysqlfastconn
- added su_getexists externalsrc
- added su_getexists cmdtarget
- added su_getexists mute
- added su_getexists profile
- added su_externalsrc (like system command)
- added su_profile (get a precision profile)
- added su_compile (allow compile (ONLY) linux makefiles)
- added su_log (can print mensages to current log file)
- added su_precache now suport get file index
- added su_load (allow load source utils extras)
- added su_unload (allow unload loaded scripts)
- added su_load_print (allow print loaded scripts)
- added su_sconsole get/set (allow get/set parms in server console cmd target)
- added su_sound (sound utils like get duration)
- added su_sqlite (allow make sqlite3 querys) (UNTESTED)
- added a Plugin load mensage (successfull load)

- added Source Utils Events! (addons/source_utils/source_utils.res)
- added event su_mysql
- added auto load for EventScripts Source Utils Events

- added 'su_tickrate' cvar to see server tickrate
- added 'su_externalsrc_folder' cvar to see ExternalSrc folder source utils is using
- added 'su_avaliable_parms' cvar know what parms can use in begin 'su_sconsole set create' (# ! $ | » >)
- added 'su_servergamedll' cvar to see what GameServerDll Source Utils is using
- added cvars callback (disallow source utils cvars change)

- added update metamod source library to v1.4

- fixed su_getexists userid can crash server if no player in server
- fixed MySQL Fast Connections dont use selected db

_________________
My Plugins:

SourceUtils
Sn4k3 Plugin Template (SPT) -> Make your own plugin. Already include some funcs.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
sn4k3
Regular


Joined: 10 Sep 2005
Posts: 178
Location: Portugal

PostPosted: Mon May 14, 2007 10:27 am    Post subject: Reply with quote

New Version

v1.4 [14/5/07]

- added 'su_mysql_userid' to su_mysql event
- added 'addons/source_utils/source_utils_security.cfg' file
- added ExternalSRC security (root access, deny programs, master password)
- added 'su_load' <[MasterPass]> Parm
- changed su_mysql* <[Var]> = gets su_mysql_userid
- fixed linux binnary dont work

_________________
My Plugins:

SourceUtils
Sn4k3 Plugin Template (SPT) -> Make your own plugin. Already include some funcs.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
3jorn
New User


Joined: 14 Nov 2005
Posts: 23

PostPosted: Fri May 18, 2007 9:07 am    Post subject: Reply with quote

any plans to reveal some sourcecode? Wink
Back to top
View user's profile Send private message
sn4k3
Regular


Joined: 10 Sep 2005
Posts: 178
Location: Portugal

PostPosted: Fri May 18, 2007 2:59 pm    Post subject: Reply with quote

3jorn wrote:
any plans to reveal some sourcecode? Wink


probaly no

_________________
My Plugins:

SourceUtils
Sn4k3 Plugin Template (SPT) -> Make your own plugin. Already include some funcs.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
HnyBear
New User


Joined: 11 Jan 2006
Posts: 8
Location: Miami, Fl

PostPosted: Mon May 28, 2007 11:27 pm    Post subject: Reply with quote

I can't seem to get the standalone version to load on a Windows server. Yes it is a css server. I have it setup just like all other addons but yet when I try to do su_version via rcon it gives me know info.

Only thing I noticed is when I try to load it, it kill mani's quake sounds for some reason. Like I said it doesn't load none of the commands work but it messes with mani mod. ???

_________________



Last edited by HnyBear on Tue May 29, 2007 12:16 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    SourcePlugins Index -> Plugins and Addons List All times are GMT - 5 Hours
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB.