0.4.1.0rc4
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

0.4.1.0rc4

Started by PPK, 16 April, 2008, 17:22:19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PPK

Windows version with GUI: http://www.ptokax.org/files/0.4.1.0rc4.7z
Windows version without GUI running as console app or service: http://www.ptokax.org/files/0.4.1.0rc4-service.7z
Linux (posix) source: http://www.ptokax.org/files/0.4.1.0rc4-posix-src.tgz

Quote from: Changes
Fixed: Not working change of language to default (thx 11hh for report).
Fixed: Not working check script syntax in gui (thx 11hh for report).
Fixed: Crash on loading xml file with comments (thx Rag3Rac3r for report).
Changed: SIGHUP in nix version is used only when running from console, and blocked when running as daemon.
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Psycho_Chihuahua

PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

baba.runner

Hi all
Have a problem with the RC4. My Scripts don't run correctly.
I have this Problem since RC3. RC2 works fine.
The problem is that a file is no more recognized.

Is this due to PtokaX or is it probably due to the script?

Thanks in advance for any assistance.

KR
baba.runner

Madman

PPK, changed the work directory, it's now the Px root instead of the scripts folder.
So some scripts needs to be changed.
("filepath\\filename") and ("filepath/filename") need to be
("scripts\\filepath\\filename")and ("scripts/filepath/filename")
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

baba.runner

Thank you Madman for this important info

KR
baba.runner

Madman

We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

PPK

Quote from: Madman on 16 April, 2008, 19:53:43
PPK, changed the work directory, it's now the Px root instead of the scripts folder.
I'm changed working directory only in posix daemon (daemon must have filesystem root as working directory), other versions don't change working directory (older versions have bug changing it to scripts directory).
Quote from: Madman on 16 April, 2008, 19:53:43
("filepath\\filename") and ("filepath/filename") need to be
("scripts\\filepath\\filename")and ("scripts/filepath/filename")
Wrong, you can't expect that you are in some directory (in your example PtokaX root).
Another script can change working directory (CrazyGuy have PX-DOS that can do that) and broke your script or user can specify config directory for service/linux version and again.. broke your script.
You must use absolute path, that's why PtokaX have Core.GetPtokaXPath() api call.
Fix will be like Core.GetPtokaXPath().."scripts/filepath/filename" ;)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

nox

Woo linux!  Super happy, now I can run from my VPS.  Few notes on my first run through of the compile/install with this build.

Everything worked pretty good.  I'm using gentoo, so installed Lua from portage and downloaded tinyxml and compiled it with your makefile and then compiled PtokaX.  Small problem, gentoo portage does not make a lua5.1 library file, it's just called lua.h, so I had to go into the makefile and change this area:

#*******************************************************************************
# Include
#*******************************************************************************
INCLUDE = -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include

#*******************************************************************************
# Binary to create
#
# Lua can be lua-5.1 instead of lua5.1 like is on Debian
#*******************************************************************************
PtokaX: obj/ClientTagManager.o obj/colUsers.o obj/DcCommands.o obj/DeFlood.o obj/eventqueue.o obj/globalQueue.o obj/hashBanManager.o obj/hashManager.o obj/hashRegManager.o obj/HubCommands.o \
  obj/IP2Country.o obj/LanguageManager.o obj/LuaBanManLib.o obj/LuaCoreLib.o obj/LuaIP2CountryLib.o obj/LuaProfManLib.o obj/LuaRegManLib.o obj/LuaScript.o obj/LuaScriptManager.o \
  obj/LuaScriptManLib.o obj/LuaSetManLib.o obj/LuaTmrManLib.o obj/LuaUDPDbgLib.o obj/ProfileManager.o obj/PtokaX.o obj/pxstring.o obj/RegThread.o obj/ResNickManager.o \
  obj/ServerManager.o obj/ServerThread.o obj/serviceLoop.o obj/SettingManager.o obj/TextFileManager.o obj/UdpDebug.o obj/UDPThread.o obj/User.o obj/utility.o obj/ZlibUtility.o
   $(CXX) -lpthread -lz -llua5.1 -lrt -o PtokaX \

I change all references for `lua5.1' to `lua' then compile worked fine.

Next thing, I recommend not having all the config files/folders set to world readable and writable.  (This means that any user on the system can change the files if they want.)  Make them by default accessible only to the user who unpacked/manages it.  I would do chmod 660 on all files and, and 770 for all folders and the PtokaX binary and that's it.  This is much better, especially when running px on a semi-public system like a VPS which you give a few friends shell access to.

Next thing, running ./PtokaX for the first time creates the cfg/ logs/ scripts/ texts/ folders just fine, but some files are missing, for example cfg/Settings.xml (or about half the files in the cfg.example/).  It was a little strange at first, but pretty easy to figure out.

Next, you are maybe the only person I have seen ever to use the sticky bit for folder permissions ;p  (the default folders created on first run of ./PtokaX).  One problem with using sticky bit permission is that once those objects are loaded into memory they will stay there (or in swap) even after you shut down the application that was using them.  It was designed to help things load faster if you use them a lot, but I don't think it even works on most unixes anymore.  At best this does nothing, at worst it will take a permanent bite out of your memory.

Next thing, running port service on port 411 in linux requries root access :<  This is not a problem for Windows users as they generally always run everything as the administrator anyway.  But I refuse to do this on linux as it opens a window into exploiting the services to gain root access.  My solution was to use iptables to forward all incoming 411 to port 8411 (which PtokaX is actually listening on).  You can also use squid to do this.

Hurraaaaaaay PtokaX on linux!  You are a king among men!


PPK

Quote from: nox on 19 April, 2008, 15:52:20
Next thing, I recommend not having all the config files/folders set to world readable and writable.  (This means that any user on the system can change the files if they want.)  Make them by default accessible only to the user who unpacked/manages it.  I would do chmod 660 on all files and, and 770 for all folders and the PtokaX binary and that's it.
I'm linux beginner, so i don't know much about file/folder permissions :(
Quote from: nox on 19 April, 2008, 15:52:20
Next thing, running ./PtokaX for the first time creates the cfg/ logs/ scripts/ texts/ folders just fine, but some files are missing, for example cfg/Settings.xml (or about half the files in the cfg.example/).  It was a little strange at first, but pretty easy to figure out.
That is why source contains config examples, so user can be able to make setup.
Quote from: nox on 19 April, 2008, 15:52:20
Next, you are maybe the only person I have seen ever to use the sticky bit for folder permissions ;p  (the default folders created on first run of ./PtokaX).
I'm used some example how to create folders, again i don't know much about that stuff.
Quote from: nox on 19 April, 2008, 15:52:20
Next thing, running port service on port 411 in linux requries root access :<
I know about this. That is why 411 is secondary tcp port, is on user if he runs is as root or not. If not then system refuse opening 411 and PtokaX will run only on primary tcp port.
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

nox

You say you are a linux beginner, but I think you are doing really well!  Much better than my first time!  Took me maybe 2 months before I could even install linux the first time heh.  I am just giving my $0.02 wherever I can to hopefully help your terrific and much appreciated efforts ^_^!

PPK

http://www.ptokax.org/files/0.4.1.0rc41-posix-src.tgz

Quote from: Changes
Fixed: High cpu usage in nix version when max file descriptors limit is reached (thx [-fun-]BHF and red_neon for report).
Fixed: File/Directory permissions in nix version (thx nox for report).
Fixed: Memory leak in hashmanager.
Fixed: Multiple compilation problems on non Debian systems (thx red_neon and Psycho_Chihuahua for report).
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Jorgo

Thank you!
Btw, will you revert the bevavior in the windows version that suddenly the paths are not correct anymore in scripts? I may understand that Linux is a different story, but so far everything has been peachy on the windows side in that respect and there's no need to break compatibility, I'd say.

PPK

http://www.ptokax.org/files/0.4.1.0rc42-posix-src.tgz

Quote from: Changes
Fixed: Compilation errors/warnings on 64bit (thx Psycho_Chihuahua for report).

2Jorgo
Sorry but i can't fix all bad scripts, they have for years call in api to get correct path. It's they fault that they don't use it.
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

CrazyGuy

Quote from: Jorgo on 20 April, 2008, 19:18:57
Thank you!
Btw, will you revert the bevavior in the windows version that suddenly the paths are not correct anymore in scripts? I may understand that Linux is a different story, but so far everything has been peachy on the windows side in that respect and there's no need to break compatibility, I'd say.

This subject has been discussed throughouly in PtokaX Admins with me, Mutor and PPK.
We came to the conclusion that in whatever situation, the path returned by Core.GetPtokaXPath() must be in the same format.

It is since 0.4.1.0RC2-posix implemented the same in every PtokaX version and points to the PtokaX root path.
Therefor, in any script for any version the way to reach the scripts folder is the following
local sScriptPath = Core.GetPtokaXPath().."scripts/"


Updating scripts accordingly seems a better way to go than having different outputs per O/S

bastya_elvtars

BTW this requires GNU Make on *NIX. On Linux, that's the default make, but on *BSD/Solaris/OSX etc. you have to install it and use the gmake command when compiling PtokaX.
Everything could have been anything else and it would have just as much meaning.

Jorgo

Quote from: PPK on 20 April, 2008, 19:40:00
http://www.ptokax.org/files/0.4.1.0rc42-posix-src.tgz

2Jorgo
Sorry but i can't fix all bad scripts, they have for years call in api to get correct path. It's they fault that they don't use it.

No problem, since you blame it on the programmers, I redirect your comments at Rincewind and bastya_elvars, whose Grimoire and freshstuff scripts respectively throw the error  ::)

Psycho_Chihuahua

Quote from: bastya_elvtars on 21 April, 2008, 19:47:24
BTW this requires GNU Make on *NIX. On Linux, that's the default make, but on *BSD/Solaris/OSX etc. you have to install it and use the gmake command when compiling PtokaX.

On debian (and possibly also ubuntu) you also need to do:

[possibly needs root priviledges]
apt-get update
apt-get install build-essential
apt-get install lua5.1*
(for all possible lua 5.1 packages - or use apt-cache search lua and then select the ones you want one by one)

build essential tools are not always installed by default on any linux distro, on some however they can be selected during first setup.


Ps. on other distro's the names could vary and centos only has lua 5.0 which is a bumber as the source files over at lua.org dont have the dev files needed to compile posix  ::)
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

SMF spam blocked by CleanTalk