GlobalMgr Packet Proxy [PHP]

Joined
Feb 16, 2012
Messages
234
Reaction score
96
based on this thread http://forum.ragezone.com/f459/globalmgr-packet-proxy-932596/
i have written a new GlobalMgr Packet Proxy in php

the reason for that is simple => i i don't want run windows binaries (.exe) files on a linux machine

here is the source for that

i have test it

Original:
Code:
[Fri Mar  7 2014 12:18:52.902028 4148930256]: GetPathString(): Section /etc/cabal/Data/Mobs.scp
[Fri Mar  7 2014 12:18:53.084008 4148930256]: GetPathString(): Section /etc/cabal/Data/Item.scp
[Fri Mar  7 2014 12:18:53.173402 4148930256]: GetPathString(): Section /etc/cabal/Data/Warp.scp

changed:
Code:
[Fri Mar  7 2014 19:53:56.292383 4149024464]: GetPathString(): Section /etc/cabal/Data/M.scp
[Fri Mar  7 2014 19:53:56.608045 4149024464]: GetPathString(): Section /etc/cabal/Data/Item_hardcore.scp
[Fri Mar  7 2014 19:53:56.806229 4149024464]: GetPathString(): Section /etc/cabal/Data/Warp_hardcore.scp

NOTE: this is only for guys they want change the scp files, science wp8 they come from database and not from common.ini

if you want know how to use it see here: http://forum.ragezone.com/f459/globalmgr-packet-proxy-php-990998/#post8007052

EDIT:// add init.d script like worldsrv

UPDATE:// the proxy forwards the packages now instantly with no delay
UPDATE:// loglevel added
UPDATE:// the proxy read now the old values and replace them, its not longer hardcoded, and i add a check to verify the data replacement

have fun with it
 
Last edited:
as example we named our proxy proxy_01.php (the ini and log file has the same name as the php file)

you must create for every worldsrv a own proxy

to use this script
add a new file in /etc/cabal and name it proxy_01.ini with this content
Code:
[NetLib]
Port=35000
IPAddress=127.0.0.1

[WorldSvr]
Warp=Data/Warp.scp
Mobs=Data/Mobs.scp
Item=Data/Item.scp

[GlobalMgrSvr]
Port=38170
Addr=127.0.0.1

change
Code:
Warp=Data/Warp.scp
Mobs=Data/Mobs.scp
Item=Data/Item.scp
to whatever you want leave it blank for default or set default scp here

after this start your proxy with
PHP:
php proxy_01.php
change in your worldsrv ini
Code:
[GlobalMgrSvr]
Addr=127.0.0.1
Port=38170
to
Code:
[GlobalMgrSvr]
Addr=127.0.0.1
Port=35000

and then start the worldsrv and have fun with you new scp files
 
Last edited:
UPDATE

i have improved the proxy now its a php5 class

to run this proy you need the php modules pcntl and posix (this proxy is a daemon)

now i post my configuration setup
first put the
Code:
cabal_proxy.php
to
Code:
/home/cabal/
and
Code:
cabal_proxy
to
Code:
 /etc/rc.d/init.d/
then set chmod
Code:
chmod 0777 /home/cabal/cabal_proxy.php
chmod 0777 /etc/rc.d/init.d/cabal_proxy

now we have our basics then we add symlinks (actualyl i dont know the right dirs from centos, my server runs on debian :D)
Code:
ln -sf /home/cabal/cabal_proxy.php /home/cabal/proxy_01_01.php
ln -sf /etc/rc.d/init.d/cabal_proxy /etc/rc.d/init.d/proxy_01_01

then we create a new .ini file in
Code:
/etc/cabal/
with the name
Code:
proxy_01_01.ini
with the following content
Code:
[NetLib]
#port for WorldSvr
Port=35000
IPAddress=127.0.0.1
Debug=0
 
[WorldSvr]
#here you can replace the scp files
Warp=Data/Warp.scp
Mobs=Data/Mobs_hardcore.scp
Item=Data/Item.scp
 
[GlobalMgrSvr]
#port from GlobalMgrSvr
Port=38170
Addr=127.0.0.1
Debug = debugmode (0= disbaled, 1=enabled)
the debugmode put all incomming tcp packages from GlobalMgrSvr and WorldSvr into a debug file in
Code:
/var/log/cabal/

now you can edit your worldsrv and change the globalmgrsrv port to 35000, start the proxy with service proxy_01_01 start and then start your worldsrv and have fun with your new scp files :)
 
then you just read again and again and again and again and again and again and again and so on till your brain get it. Stricted explained already exactly how does it work.
 
does anyone have these files already ready
I put on centos and run the commands because of this error here

Stricted - GlobalMgr Packet Proxy [PHP] - RaGEZONE Forums


 
Back