Syntax42
Posts
-
Found a UI bug. I’m not sure if it is the one Cannon is referring to. The “Character Created” date is the time the program read the character file. The previous version showed the correct date and time the character was created.
-
There are two types of computer vulnerabilities to consider when setting up a server: remote attacks and humans with access. By limiting who has physical and digital access to your server, you can reduce the risk of a human with access causing a security issue. Also, by not using the computer for regular internet browsing and ensuring files are scanned for viruses, human error is almost eliminated. A good firewall is the best way to prevent remote attacks from affecting your server. Programs, processes, and Windows services listen on open ports for all sorts of incoming connections. All an attacker has to do is know how to attack one program to make it cause undesired effects on the entire computer. Securing all of your ports by only allowing FLServer and possibly a remote desktop program to use the internet is the best way to prevent attacks.
That said, there is a vulnerability in FLServer. I have seen it prevent Windows Remote Desktop from being able to access a server while it is under attack. I am referring to the DDOS attacks. The attacker can’t make your computer run unwanted programs, but they can prevent the server from being used and make players disconnect due to lag. I have only confirmed one firewall program as being able to prevent the attacks, but I know of one other that should work. If you need a recommendation on a firewall, PM me. Discussing it in public, where the attacker can read about what we use to stop him is not a good idea.
-
I’m working on a crafting plugin for my server that includes codename weapons due to the above mentioned restriction. I suppose I could share it with you if you were really interested…
-
It looks like the cheat detection kicks were only occurring in my special admin ship. I was getting kicked for buying any cargo at a base for some unknown reason. Buying cargo worked fine when I used a legitimate character.
The .ini file is still backwards, but that is easy enough to work around.
-
I don’t have the math on this ready, but if you know how to perform physics calculations, it shouldn’t be too hard. Use wikipedia or a search engine to figure out what each number should do. Or, just play around with the numbers until you find something that “feels” right.
Look in \DATA\shiparch.ini
Among other things, each ship should have the following:
mass = 100.000000
steering_torque = 24000.000000, 24000.000000, 58000.000000
angular_drag = 15000.000000, 15000.000000, 35000.000000
rotation_inertia = 2800.000000, 2800.000000, 1000.000000 -
The cleaner worked ok. It only corrupted a handful of characters but I do have backups. I think I can recover the characters manually because they are only missing the “[p” from “[player]” at the beginning of the files.
I wouldn’t be surprised if this started because of someone using the /restart command. We didn’t have it set up on the server but a couple people managed to use it somehow and corrupted their characters. Restart plugin has been removed for now.
-
initialworld.ini only has NPC_Locked_Gates in it when using the latest Discovery mod.
I’m going to try this:
http://forums.seriouszone.com/showthread.php?51999-FL-Player-CleanerEdit: Hmm, broken download link
-
My server has recently started locking people in/out of the New York system, as well as a few other jump gates being locked. When players attempt to dock with one of these gates, the female voice says, “Access denied.” I can’t seem to figure out how to unlock them. Editing the save files to remove the locked gates lines didn’t work. The server adds them right back in when I log in.
I am running the Discovery mod and several plugins. None of my plugins should be doing this.
Does anyone know how to fix this?
-
In the econ folder, this syntax is shown:
; MarketGood = base_nickname, commodity_nickname, price, 1=sell+buy, 0=buy only
Setting a commodity to 1 does not allow the base to sell the item. Setting it to 0 makes the item show up, but causes either FLHook’s (using v1.6.0) built-in anti-cheat or DSAce’s anti-cheat to kick the player for cheating when they launch from the base. I didn’t see any message in the cheats or kicks logs.
Is it just backwards in the DSAce code, or backwards in the econ file? Is the anti-cheat going to take some time to make a work-around so server operators can modify the economy?
-
Thanks again! I was trying several different ways to use localtime->yday() with no luck. If I had known about time() and int(), I could have done it, I think. I wasn’t sure about “*” and “^” working as math operators in Perl, but it looks good.
Here is the link to 0.6.1 from your site, in case anyone else comes across this thread and needs it to fix the death logger plugin I posted about in another forum:
http://yspstudios.linuxniche.net/files/freelancer/FLPHook-v0-6-1.zipI have attached the bank plugin version I am using. It required one minor fix for withdrawals to work properly when going beyond the min or max values set in the configuration file. “my $withdraw = &bank_withdraw($account, $amount);” had to go below the first two “if” statements or the player could lose money when attempting to go beyond the min/max values. I also removed the unused logging code.
Hmm, I guess it won’t let me upload a .pl or .txt. Looks like I have to put the entire code on here…
One more edit… the “^” is not for exponentiation, “**” is.
# FL-Perl Bank Plugin # Copyright 2008, Fenris_Wolf, http://yspstudios.linuxniche.net # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. plugin_register { name => 'bank', author => 'Fenris_Wolf', version => '1.2', date => '12/25/2008', description => 'adds banking commands', },{ help2 => sub{ send_green $_[0]->{id}, '/bank -- stores and transfers money (type command for help)'; }, bank => sub{ my $e = shift; my ($text,$from,$id)= @$e{qw{text from id}}; if (!$text) { send_green $id, '--------------- banking system help ---------------', '/bank balance -- shows how much money you got in the bank', '/bank withdraw (amount) -- withdraws money from your bank to this character', '/bank deposit (amount) -- deposits money to your bank from character', '/bank send (character) (amount) -- transfers money to another players bank account. they do not need to be online'; return undef; } my $account = paccount $id; &bank_addinterest($account); &bank_settimestamp($account); if ($text =~ /^ *balance *$/i) { my $balance = &bank_get($account); send_green $id, "current bank balance: $balance"; return undef; } my $cash = getcash $id; if ($text =~ /^ *deposit +([0-9]+) *$/i) { my $amount = $1; my $min = $Options->{bank}{deposit_min}; my $max = $Options->{bank}{deposit_max}; if ($min > 0 && $amount < $min) { send_red $id, "min deposit $min credits. aborting."; return undef; } if ($max > 0 && $amount > $max) { send_green $id, "max deposit $max credits. adjusting."; $amount = $max; } if ($amount > $cash) { # too much &bank_deposit($account, $cash); delcash $id, $cash; send_green $id, "Insuffecent funds. Depositing $cash"; } else { &bank_deposit($account, $amount); delcash $id, $amount; send_green $id, "$amount credits transfered to your bank account"; } } elsif ($text =~ /^ *withdraw +([0-9]+) *$/i) { my $amount = $1; my $min = $Options->{bank}{withdraw_min}; my $max = $Options->{bank}{withdraw_max}; if ($min > 0 && $amount < $min) { send_red $id, "min withdraw $min credits. aborting."; return undef; } if ($max > 0 && $amount > $max) { send_green $id, "max withdraw $max credits. adjusting."; $amount = $max; } my $withdraw = &bank_withdraw($account, $amount); if ($withdraw < $amount) { # not enough addcash $id, $withdraw; send_green $id, "insuffecent funds in bank. withdrawing $withdraw"; } else { addcash $id, $amount; send_green $id, "$amount withdrawn from your bank account"; } } elsif ($text =~ /^ *send +(\S+) +([0-9]+) *$/i) { my ($to, $amount) = ($1,$2); my $to_account = getaccountdirname $to; if (!$to_account) { send_red $id, "can't find a player named $to (wrong spelling?)"; return undef; } my $min = $Options->{bank}{transfer_min}; my $max = $Options->{bank}{transfer_max}; if ($min > 0 && $amount < $min) { send_red $id, "min transfer $min credits. aborting."; return undef; } if ($max > 0 && $amount > $max) { send_green $id, "max transfer $max credits. adjusting."; $amount = $max; } my $transfer = &bank_withdraw($account, $amount); &bank_deposit($to_account, $transfer); if ($amount > $transfer) { # too much send_green $id, "insuffecent funds. Tranfering $transfer credits to $to"; } else { send_green $id, "$amount credits transfered to $to\'s bank account"; } } } }, undef; sub bank_addinterest { my $account = shift; my $balance = &bank_get($account); my $rate = $Options->{bank}{interest_rate}; #read time stamp in account - similar to our bank_get() sub my $timestamp; open MEMO, $Options->{main}{accountpath}.$account."\\banktime" or return undef; read MEMO, $timestamp, 50; close MEMO; #calculate number of days that have passed my $dayspassed = time() - $timestamp; # here $dayspassed is in seconds $dayspassed /= 86400; # divide by number of seconds per day # using int( ) will do rounding off for us my $newbalance = int( $balance * (2.7183 ** ($rate * $dayspassed)) ); &bank_set($account, $newbalance); }; sub bank_settimestamp { my $account = shift; # get time as number of seconds since epoch (jan 1 1970) my $t = time(); open MEMO,'>', $Options->{main}{accountpath}.$account."\\banktime" or return undef; print MEMO $t; close MEMO; }; sub bank_get { my ($account, $return) = shift; open MEMO, $Options->{main}{accountpath}.$account."\\bank" or return 0; read MEMO, $return, 50; close MEMO; return $return; }; sub bank_set { my ($account, $balance) = (shift,shift); open MEMO,'>', $Options->{main}{accountpath}.$account."\\bank" or return 0; print MEMO $balance; close MEMO; }; sub bank_deposit { my ($account, $amount) = (shift, shift); my $balance = &bank_get($account); &bank_set($account, $balance + $amount); }; sub bank_withdraw { my ($account, $amount) = (shift, shift); my $balance = &bank_get($account); if ($balance < $amount) { &bank_set($account, '0'); return $balance; } my $max = $Options->{bank}{withdraw_max}; &bank_set($account, $balance - $amount); return $amount; }; 1;
-
I was hoping the finish the interest part of your banking plugin in the download mentioned above. Logging isn’t important to me, so I deleted that part from the code I’m working with.
I added two new subroutines, called immediately after “my $account = paccount $id”.
I don’t know enough about Perl to finish this. It could take me days to read up on how to do this and I am willing to spend that time if I have to. I’m not sure if the localtime() function can output a day/year format that would be easier for the program to calculate from, or if Perl can do a days-passed calculation on its own. If you could finish this or point me in the right direction, I would appreciate it. I will post a link to the updated plugin when this is done.
sub bank_addinterest { my $account = shift; my $balance = &bank_get($account); my $rate = $Options->{bank}{interest_rate}; #read time stamp in account #calculate number of days that have passed # $balance = $balance * 2.7183 ^ ($rate * dayspassed) rounded to whole credits, or just drop the credits after the decimal &bank_set($account, $newbalance); }; sub bank_settimestamp { my $account = shift; my $t = localtime(); open MEMO,'>', $Options->{main}{accountpath}.$account."\\banktime" or return undef; print MEMO $t; close MEMO; };
-
plugin_register { name => 'pvplogger', author => 'Fenris_Wolf', version => '1.0', date => '12/27/2009', description => 'logs pvp kills to a file' }, undef, { 'kill' => sub{ my $e = shift; my $system = psystem plid('char',$e->{victim}); my $t = localtime(); open FILE, '>>', $Options->{pvplog}{logfile} or return undef; if ($e->{type} eq 'player') { print FILE "$t - System: $system Killer: $$e{killer} \tVictim: $$e{victim}\n"; } else { print FILE "$t - System: $system Killer: $$e{type} \tVictim: $$e{victim}\n"; } close FILE; } }; 1;
I made a small change so it would log both PvP and PvE kills without giving an error. Also, the system had to be changed to the victim’s instead of the killer’s.
-
Thanks for taking the time to make that work!
-
plugin_register { name => 'pvplogger', author => 'Fenris_Wolf', version => '1.0', date => '12/27/2009', description => 'logs pvp kills to a file' }, undef, { 'kill' => sub{ my $e = shift; open FILE, '>>', $Options->{pvplog}{logfile} or return undef; print FILE "$$e{event_text}\n"; close FILE; } }; 1;
and the log file had
victim=killarr type=suicide
victim=targetpractice type=player by=killarrGood enough for what I want. I can parse that manually and only turn it on when I need it. PvE deaths may be included in my server’s system anyways.
-
The log is still empty with the typo fixed.
-
DeathMsgTextPlayerKill=Death: %victim was killed by %killer (%type)
from flhook.ini
Its either 1.6.0 or 1.5.9.
The log file you expected output to is empty.I can get rid of the death message customization if that’s what it takes to make this work.
[PvPLogger] was fixed and I got the same error.
-
Use of uninitialized value in string eq at C:\PROGRA~2\Microsoft Games\Freelancer\EXE\FLPHook\lib\FLPHook\pvplogger.pl line 13.
[PvPLogger]
logfile = pvplog
I also tried pvplog.log
I’m not really sure if it requires a log file to be pre-made or where it would put one if there wasn’t one, but I don’t think the error had to do with that. The error makes me think it is really with this line of code:print “$t - System: $system Killer: $$e{killer} Victim: $$e{victim}\n”;
-
Thanks! I’ll be the guinea pig and test it out. I’ll post again if I get it working or not.
-
Fenris_Wolf wrote:
running a sniffer for logging tcp kills seems a bit…overkill
why not just capture the kill msgs from FLHooks TCP socket eventmode?I have no clue how to do that. I can barely write C programs.
It looks like DSAce added full chat logging on the client side. I can probably have an admin logged in to a dummy account 24/7 in Bastille (Discovery mod’s prison system) so he only gets and logs player deaths.
Line break down.
DS Account Manager
FLServer Security Issues?
Increasing how many times a player can loot a wreck?
DSAce bug?
Ship Handling
Locked Gates?
Locked Gates?
Locked Gates?
DSAce bug?
Perl over FLHook's TCP
Perl over FLHook's TCP
Possible to log PvP kills?
Possible to log PvP kills?
Possible to log PvP kills?
Possible to log PvP kills?
Possible to log PvP kills?
Possible to log PvP kills?
Possible to log PvP kills?
Possible to log PvP kills?