[Release] Online Time Cash Script

03/19/2014 00:45 TrunCake#1
Hi Leute,

da dies nun schon in der Black Market Sektion veröffentlicht wurde und ich es eigentlich kostenlos anbiete hier nochmal für die Leute die es benötigen.
Ein ganz simples aber effektives Bash Script, welches über die automatische Cronjob Funktion eures Servers läuft und somit auch eine 100 prozentige Sicherheit gewährleistet werden kann. Solange niemand Zugriff auf euren Server bekommt, dann geht der Fehler aber nicht vom Script aus sondern ist euer Eigenverschulden ;)


Zunächst einmal zur grundlegenden Information was das Script genau macht.
Stündlich wird Cash in der Höhe die ihr bei der Installation angebt auf die Accounts gutgeschrieben die zu dem Zeitpunkt der Ausführung auf eurem LastChaos Server online sind.
Es legt automatisch ein Logfile an in dem eingetragen wird wieviel Accounts zu dem Zeitpunkt online gewesen sind und wieviel insgesamt gutgeschrieben wurde, sowie alle IP´s die in dem Moment auf euren Server connecten und die Anzahl der Verbindungen jeder einzelnen IP.
Somit habt ihr immer einen Überblick darüber wieviel Cash ihr so an eure Community verschenkt und könnt immer nachverfolgen wer eures erachtens nach vielleicht zuviel mit Multiaccounts davon abgreift :D


Die Installation ist relativ einfach und idiotensicher für euch gemacht, so dass auch niemand "Fremdes" dafür nötig ist um euch das abnehmen zu müssen.

Das einzige was ihr dazu tun müsst ist euch via Putty auf eurem Server einloggen und als Benutzer "Root" anmelden.
Als nächstes führt ihr die folgenden Schritte in der Konsole aus und gebt die verlangten Daten ein.

wget [Only registered and activated users can see links. Click Here To Register...]
chmod 777 cashinstall.sh
./cashinstall.sh

Zur Sicherheit für euch selber gebt ihr einfach einen MySQL User an der nur auf Localhost connected.
Das ist ein völlig automatisiertes Installationsscript, welches sich nen eigenen Ordner erstellt mit dem Cash-Script und dem besagtem Logfile darin. So wie einen eigenen stündlichen Cronjob, zu finden unter dem Server Pfad etc/cron.hourly.
Wer es vorher überprüfen möchte was genau drin steht kann es selbsverständlich einfach so auf seinen PC runterladen bevor er es auf seinem Server ausführt, sowie über die Links die im Script selber drin stehen das Cash-Script an sich.

Falls jemand nen anderen Intervall für die Ausführung benötigt erkläre ich es gerne wie man den Cronjob dafür entsprechend anpasst.
Oder es für seinen EP3 Server verwenden will, da ich mal davon ausgehe dass die meisten die Datenbank Struktur verwenden so wie sie beim Release vorzufinden war, dafür ist nur eine zusätzliche Variable nötig.


Created by ●Attitude Gaming Network●




Lg
03/19/2014 01:50 SCARFACΞ™#2
Nice One das auch mal hier auf Epvp etwas geshared wird.
03/19/2014 11:47 l3 E A S T+#3
Super Script, schön, dass du es geteilt hast!
03/19/2014 14:53 Chicken.ShooT#4
Quote:
Originally Posted by TrunCake View Post
Oder es für seinen EP3 Server verwenden will, da ich mal davon ausgehe dass die meisten die Datenbank Struktur verwenden so wie sie beim Release vorzufinden war, dafür ist nur eine zusätzliche Variable nötig.
Das kann jeder selbst machen mit dieser Anleitung. Gilt nur dafür wenn eure bg_user in einer anderen Datenbank liegt, als die t_users (wie die Ep3-Files released wurden halt)!

Dafür öffnet ihr einfach autocash.sh in eurem Editor. Und fügt unter auth_db=blabla eine neue Zeile ein, z.b. user_db=blabla2. Dann muss hinter "select=" das $auth_db in $user_db geändert werden und unten noch für das Logfile.

grün markiert..
[Only registered and activated users can see links. Click Here To Register...]
03/20/2014 17:26 PizzaGuy#5
It's not very efficient to do it this way. The script doesn't even keep track of how long each account has been online. You need to pull the last login from t_connect_log and calculate how long the account has been online (if it is online) from the last login.

If I get time, I will add a online time cash bonus thread to my cash server.
03/20/2014 21:51 Chicken.ShooT#6
It's a good idea, but t_connect_log isnt the answer, because t_connect_log is a log :D there are all logins listed... you need to select another timestamp.

WHERE: t_users.a_zone_num > '-1';
WHERE 2: t_connect_log.a_date >= (NOW() - INTERVAL 5 MINUTE)

Now you have 2 Conditions, but WHERE 2 is everytime complied..
03/20/2014 22:53 PizzaGuy#7
Quote:
Originally Posted by Chicken.ShooT View Post
It's a good idea, but t_connect_log isnt the answer, because t_connect_log is a log :D there are all logins listed... you need to select another timestamp.

WHERE: t_users.a_zone_num > '-1';
WHERE 2: t_connect_log.a_date >= (NOW() - INTERVAL 5 MINUTE)

Now you have 2 Conditions, but WHERE 2 is everytime complied..
It is the answer, you need to first check if the account is online and when the account was logged on before you can begin to determine how long the account has been online.

PHP Code:
# Pull a_idname And a_portal_index From t_users
SELECT a_idname,a_portal_index FROM newproject_db.t_users WHERE a_zone_num > -1;

# Pull Last Login Date
SELECT a_date FROM newproject_db.t_connect_log WHERE a_idname = a_idname ORDER BY a_date DESC LIMIT 1;

# Update Cash
UPDATE newproject_db_auth.bg_user SET cash = cash + bonus WHERE user_code = a_portal_index; 
Once you pull the last login date, you can calculate that against the current time to determine how many minutes its been online. I personally would just store all the online accounts into a linked list and then you don't even need to bother with pulling the last login time from the database. Just keep track of which accounts are still online and which are not. If the account exceeds the time limit, give it cash and then set the timer for that account back to the current time-stamp (what I will most likely do with my cash server for speed and efficiency).
03/21/2014 03:38 TrunCake#8
Yes i know its not perfect, but i said it is a simple Script to add Cash in a time interval, not more no less.


Quote:
Originally Posted by PizzaGuy View Post
It is the answer, you need to first check if the account is online and when the account was logged on before you can begin to determine how long the account has been online.

PHP Code:
# Pull Last Login Date
SELECT a_date FROM newproject_db.t_connect_log WHERE a_idname = a_idname ORDER BY a_date DESC LIMIT 1; 
Once you pull the last login date, you can calculate that against the current time to determine how many minutes its been online. I personally would just store all the online accounts into a linked list and then you don't even need to bother with pulling the last login time from the database. Just keep track of which accounts are still online and which are not. If the account exceeds the time limit, give it cash and then set the timer for that account back to the current time-stamp (what I will most likely do with my cash server for speed and efficiency).
That is not quite perfect and properly too, you cant set LIMIT 1 on the end of your Query if you want select more than one result.
The only one what you get is the last Row ordered by a_date and the Query is on the end.
03/21/2014 06:47 PizzaGuy#9
Quote:
Originally Posted by TrunCake View Post
Yes i know its not perfect, but i said it is a simple Script to add Cash in a time interval, not more no less.




That is not quite perfect and properly too, you cant set LIMIT 1 on the end of your Query if you want select more than one result.
The only one what you get is the last Row ordered by a_date and the Query is on the end.
The limit is to pull only one result from the database (the last login for that account). Why would you want to pull every single time the account has logged on. You only need to know the last (current session). So yes, my query is correct.
03/21/2014 11:06 GaryWashington™#10
gibt hier sogar noch welche die was vor free releasen erstaunlich
05/10/2014 16:03 devil1211#11
ist das noch irgend wo online ???
05/12/2014 05:07 devil1211#12
ist das normal wen man das gemacht hat das die autocash.sh datei leer ist ????
05/12/2014 13:05 mansen01#13
Nop eigentlich net da ja da die befehle und connection drin stehen
05/12/2014 14:14 devil1211#14
Quote:
Originally Posted by mansen01 View Post
Nop eigentlich net da ja da die befehle und connection drin stehen
woran könnte das liegen ???
05/12/2014 14:23 mansen01#15
Diese frage ist berechtigt

Seit wann nutzen sie diesen script ?
Da ich gesehen habe das der download auch net mehr recht funzt

Empfehlung organisieren sie sich von jemanden die autocash.sh

Und ändern sie auf ihre bedürfnisse