AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   System CMD (https://forums.alliedmods.net/showthread.php?t=234103)

ProIcons 01-25-2014 10:00

System CMD
 
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) ?

YamiKaitou 01-25-2014 10:42

Re: System CMD
 
No

ProIcons 01-25-2014 10:45

Re: System CMD
 
So i guess the only possible way , is to create a C++ Module and make the calls from there. Ok...

YamiKaitou 01-25-2014 10:46

Re: System CMD
 
If you plan on doing this, keep it to yourself on your own servers. No GSP will allow this type of module

ProIcons 01-25-2014 10:55

Re: System CMD
 
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.

fysiks 01-25-2014 13:55

Re: System CMD
 
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).

ProIcons 01-25-2014 17:16

Re: System CMD
 
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?

fysiks 01-25-2014 22:11

Re: System CMD
 
Quote:

Originally Posted by ProIcons (Post 2090893)
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.

ProIcons 01-26-2014 07:05

Re: System CMD
 
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.


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

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