Jump to content
Sign in to follow this  
Synide

ArmA Server Side Scripting

Recommended Posts

Yeah it's great.

A bit funny that it's been there since 1.0 though smile_o.gif

Share this post


Link to post
Share on other sites

I am afraid before 1.08 the real functionality given by this is quite limited, because the signatures, which are core of the whole system, are broken.

I hope once 1.08 is released this will become a very handy tool.

Share this post


Link to post
Share on other sites

Looks very interesting. Is there a way to log information to a file based on this ? For example, I can imagine that you might want to record the reason for a ban or just keep a log of 'suspicious' activity without going as far as banning or kicking.

Share this post


Link to post
Share on other sites

Suma,

You say in the server.cfg page that the parameter

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onUserConnected="command";

maybe specified.

Is 'command' restricted to the 'Admin' commands + the additional level checkFile [id,name] and numberOfFiles id?

Or can you run a script file from within the string specified?

ie.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onUserConnected="_dummy = [_this] execVM ""scripts\Admin\UserConnected.sqf"";";

Thanks.

edit: Oh, if you can run script where does the VM look for the script? In the current mission or in a server-side .pbo?

Share this post


Link to post
Share on other sites
Or can you run a script file from within the string specified?

ie.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onUserConnected="_dummy = [_this] execVM ""scripts\Admin\UserConnected.sqf"";";

Thanks.

edit: Oh, if you can run script where does the VM look for the script? In the current mission or in a server-side .pbo?

If it works as the rest of ArmA works, you can manually specify from which pbo to take scripts:

onUserConnected="[_this] execVM ""\SIX_AdminScripts\UserConnected.sqf"";";

Would look in the pbo: SIX_AdminScripts

Share this post


Link to post
Share on other sites

@Sickboy... so... have you had time to try this?

I can't seem to get any joy out of it... it's always the case... all comes down to info... have know these commands existed for frik'n ages but have not known how to make use of them or even initiate them. - "it's hard to see through the window when the blinds are half closed." - ignore the whinge... i'm just tired and listless after mucking around 'joyfully' with v1.08 last night... lol.

Share this post


Link to post
Share on other sites

In regards to the Verify Signitures they appear to be working now, It detected my FDF sound mod and wouldn't allow me to join, Once FDF was removed I connect fine. Now all we need is a way to allow third party addons to be signed.

Share this post


Link to post
Share on other sites
edit: Oh, if you can run script where does the VM look for the script? In the current mission or in a server-side .pbo?

As stated in the Wiki it searches here:

Quote[/b] ]The Script is first searched for in the mission folder, then in the campaign scripts folder and finally in the global scripts folder

But wth is the global scripts folder?

Share this post


Link to post
Share on other sites

That is the script folder in your user dir just like sound files and such, means if everyone has the same scriopts in there global script folder they can just run the scripts from there making it so the mission maker doesnt have to add them into the mission. or something very simler.

Share this post


Link to post
Share on other sites

Ive tried running this:

Quote[/b] ]

#exec 0 checkFile JoeBlogs

and nothing happend. Is that how it works?

Share this post


Link to post
Share on other sites
Ive tried running this:
Quote[/b] ]

#exec 0 checkFile JoeBlogs

and nothing happend. Is that how it works?

No, you must check the playerid or connectionid, not the playername.

Check the id through #userlist

afaik.

@ earlier question: Didn't look into it as I have no application for it yet, might in the future though.

As it seems, the method should be:

Put a script named "UserConnected.sqf" inside ur scripts folder as described by Matt R, then add this to server config:

onUserConnected="[_this] execVM 'UserConnected.sqf'";

Share this post


Link to post
Share on other sites

yes, hmmm i'm gonna try that now...

the global scripts location refers to where ever the bin.pbo>config scriptsPath="yadda"; refers to on the server.

If the dedi is still plain vanilla then it'll point into the ca>data>scripts folder...

If your running a Mod server-side that has altered that to "SIX_AdminScripts" then the execVM command will go mission>campaign>global yes I realise that... sorry what I'm asking is... has anyone actually got it working? as I haven't as yet...

'cause the

Quote[/b] ]"The scripting language shares the core (overall structure and syntax, arithmetic operations, control structures) with the scripting used in the game. The are a few commands specific to Server Side Scripting:"
might not mean we access to spawn execVM threads outta the server.cfg events...

And, I was looking for clarification from 'anyone' devs/community that could even confirm if we are restricted to just the standard Admin commands + the couple of new admin commands being the only things you can put inside the quotes or whether we can run a whole suite of 'external' scripts...

Sorry, I'm blathering abit... been a long day...

This whole area of admin scripting is quite a significant area and i'm keen as alot of others probably are too, to exploit it's potential.

I'll shove off and do some testing now... cheers.

Share this post


Link to post
Share on other sites

Afaik, the global scripts folder is the folder inside the user folder as Matt describes and not the Scripts folder set in the dta\bin\config.bin

(which should be wrong anyhow, as it gets ovewrriten by Addons\ca\config.bin smile_o.gif)

When I got some spare time I can look around for u, in the meantime lemme know ur results when tested smile_o.gif

About the ExecVM stuff it's possible that we are not able to spawn a script from within the Events, though I would seriously find it weird if that were the case...

If I understand correctly though, as it runs in it's own VM, it's very possible that we are quite limited as to what we can do with all the information we have available in there :S

Share this post


Link to post
Share on other sites

Hmmm will have to double check that... 'cause i was pretty sure... but could be wrong... and it gets overwritten by ui.pbo>config not the ca>config... but lets not squible over the rats and mice stuff...

yeah i'd find it strange too... i'll do some testing tomorrow anyhoo... cheers

edit: I think this is not going to be as feature-some as first anticipated, as have tried numerous setups without luck.

I think this excerpt says it all...

Quote[/b] ]The server has a separate Virtual Machine (VM) running administration scripts. This VM is completely independent on the game scripting environment and is designed to automate some administration tasks related to player administration and cheat detection.

oh well, how sad never mind.

Share this post


Link to post
Share on other sites
Afaik, the global scripts folder is the folder inside the user folder as Matt describes and not the Scripts folder set in the dta\bin\config.bin

So on a server machine it should be with in the user folder of the user which is starting the server....

Share this post


Link to post
Share on other sites

@Sickboy/Matt...

I checked your assertion regarding the execVM command.

first i pulled my mission function script out of the mission. I ran the mission and of course it did not find it.

I created a 'scripts' folder in My userprofile folder and placed the function script in there. ArmA did not find it.

scriptsPath is initially defined in bin.pbo>config and then overidden in ui.pbo>config.

I created a .pbo that overides the scriptsPath to point to the a subfolder within the new pbo called 'scripts' and placed my function in this folder. compressed it into a pbo, stuck it in 1 of my AddOns folders.

And ran the game... well the mission found the script compiled it and made use of it as a function.

So, where is this 'global' scripts folder that you guys refer too?

also, I cannot get the execVM command to run from with the onUserConnect=""; in the server.cfg.

The biki says it shares the core functionality with the scripting language, but with at least an example from Suma or any of the dev team i'm not going to waste anymore time on it.

Cheers.

Share this post


Link to post
Share on other sites

Please, do simple example for next task:

Player has not signed addon, I wish automatically kick such person. What do I need?

I just add these strings to server.cfg

verifySignatures=1;

onHackedData="kick id";

onDifferentData="kick id";

onUnsignedData="kick id";

Nothing happend, time to time most players disconnected with "Signature check timed out" reason. What is it? On my server only 2303-2304 UDP is opened. May be checking use other ports?

Share this post


Link to post
Share on other sites
Please, do simple example for next task:

Player has not signed addon, I wish automatically kick such person. What do I need?

I just add these strings to server.cfg

verifySignatures=1;

onHackedData="kick id";

onDifferentData="kick id";

onUnsignedData="kick id";

Instead of kick id use kick _this select 0. As usual, arguments are passed to the event handler as an array in _this.

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onUserDisconnected="ban _this select 0";

The ultimate solution to keep people playing.

Share this post


Link to post
Share on other sites
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onUserDisconnected="ban _this select 0";

The ultimate solution to keep people playing.

Or, the ultimate 100% sure way to keep cheaters out:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onUserConnected="ban _this select 0";

^^^ biggrin_o.gif

@Suma: Is there any timeframe when we can expect the addon signing utility? Without it, a secure server cannot allow any kind of mods.

Share this post


Link to post
Share on other sites

@Suma... So, it appears from your example that we are only capable of using the 'Admin' command set from within the server.cfg eventHandlers? Is that correct?

Share this post


Link to post
Share on other sites

Or, the ultimate 100% sure way to keep cheaters out:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onUserConnected="ban _this select 0";

why it does not work ? huh.gif

Share this post


Link to post
Share on other sites

Or, the ultimate 100% sure way to keep cheaters out:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onUserConnected="ban _this select 0";

why it does not work ? huh.gif

Well that was a joke actually - think about it. It will not only keep cheaters out, it will ban everyone who joins the server. I don't think that's what a server admin will be aiming for.

Share this post


Link to post
Share on other sites
Well that was a joke actually - think about it. It will not only keep cheaters out, it will ban everyone who joins the server. I don't think that's what a server admin will be aiming for.

i know smile_o.gif i was try it for a test if it does work

i want make script for kicking players with empty and inappropriately nicknames

sry for my english xmas_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×