Raised This Month: $ Target: $400
 0% 

System CMD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 01-25-2014 , 10:00   System CMD
Reply With Quote #1

is there any possible way to execute an application through amxmodx scripting and get its pid? For instance , to execute HLTV that is in the same directory with the hlds, and when a match is over to terminate it through its pid with system(kill -9 pid) ?
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-25-2014 , 10:42   Re: System CMD
Reply With Quote #2

No
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 01-25-2014 , 10:45   Re: System CMD
Reply With Quote #3

So i guess the only possible way , is to create a C++ Module and make the calls from there. Ok...
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-25-2014 , 10:46   Re: System CMD
Reply With Quote #4

If you plan on doing this, keep it to yourself on your own servers. No GSP will allow this type of module
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 01-25-2014 , 10:55   Re: System CMD
Reply With Quote #5

Of course they won't.It can cause a lot of trouble, though it might be useful and handy in rare situations, like the one i mentioned before.

1) Create HLTV Process with your custom Config
2) Connect to the HLTV through UDP Sockets
3) Record a Specific Match through HLTV
4) Grab the File and Upload it to your FTP Server
5) Done, Terminate HLTV Process.

In fact the termination of the HLTV Process can be achieved even with RCON Protocol. So in the only phase it is required, is in the Creating Process Phase.

But like you said it hides a lot of dangers. GSPs wouldn't want someone play with Internal System commands.
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))

Last edited by ProIcons; 01-25-2014 at 10:57.
ProIcons is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-25-2014 , 13:55   Re: System CMD
Reply With Quote #6

Just leave the HLTV running unconnected. Send it commands to connect/disconnect. This is already done by the plugin "HLTV Report" (assuming it still works).
__________________
fysiks is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 01-25-2014 , 17:16   Re: System CMD
Reply With Quote #7

Think about 100 Servers, And now think about 70 Active games. We would need 70 HLTVs. Why have 100 Running? Getting more Memory and more CPU resources?
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-25-2014 , 22:11   Re: System CMD
Reply With Quote #8

Quote:
Originally Posted by ProIcons View Post
Think about 100 Servers, And now think about 70 Active games. We would need 70 HLTVs. Why have 100 Running? Getting more Memory and more CPU resources?
Why would you need 70 HLTVs? You already implied that they wouldn't already all be connected at the same time. You only need as many as will be active at any one time. So, if you have 70 servers running but only need 10 of those to have an HLTV in them, you simply only need 10 HLTV.
__________________
fysiks is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 01-26-2014 , 07:05   Re: System CMD
Reply With Quote #9

Maybe you didnt understood my concept. There are 100 Servers.
There's also a Queue System in which decides which hltv will connect to each server.
For example 1 Day 70 servers might be full at a time, having 70 active games.
IN one other day 40 server might be active, but in other one 90 maybe active.
We do not know the exact number of games can be issued simultaneously.

Now lets go to my other concept. I have written a Management Core in C. This one can
manage Unix and Windows Boxes and is able to start any process through SSH. So every
time a game is needed i'm starting on a (Screen in Unix) and just in normal Console Window
for Windows. So everytime a game ends, it waits for amxx to finish all the calculations of
the in game stats, sent them to the core through sockets, and then its getting terminated

If i have a static number of hltvs, except of wasting a significant ammount of Processing
power and memory capacity, there is the possibility for the active matches to be more than
the active hltvs , that will have as a result a match to not get recorded. Thats a disaster.
I could easily start hltv along with hlds from my core but i wanted the HLTV to be managed
directly from the game server its self. But like i said its also achievable by our core. By assigning
this task to Core System, Core will have to monitor each game, to be aware of its status and
when it will end, upload the demo to a ftp server, create new SSH Session or UDP Socket in order
to terminate the hltv its self instead of just closing the game server through its already opened
tcp socket .The Amxmodx supposed to be the way of managing a game server without having any
other 3rd party application. In this way core has more responsibilities, so it has more processing
needs. Imagine that for like 100 Servers. This would be laggy.
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode