FW Server Source Research.

Results 1 to 3 of 3
  1. #1
    Valued Member Mistigri is offline
    MemberRank
    Oct 2020 Join Date
    Forsaken WorldLocation
    120Posts

    happy FW Server Source Research.

    ---My own Server Compiler(Built on VMWARE 16):

    This VM contains both v305 & v306 default Server Sources from shenmo.7z and I have used skills source from december 3rd 2015 from wskill_gen.2015-12-04.tgz that @Fyyre has shared.


    *FW_Server_Compiler(2022):
    https://drive.google.com/file/d/1gIJHud3mV5Olo4xgeyTjNWM5YVcOGTNr/view?usp=sharing



    VM login:
    username=root
    password=123456


    I had to update my server compiler because the First Server Compiler had bugs preventing from compiling skills & gdeliveryd properly.

    ---Useful links:
    *This is the fedora archive website to download Fedora old operating systems and much more!
    https://archives.fedoraproject.org/p.../fedora/linux/

    *As stated by Fyyre,you need Fedora core 2 (i386):
    https://forum.ragezone.com/f783/fedo...lease-1195783/
    ->In the same link datcom has uploaded a server compiler built on Virtualbox for us to have fun with!

    *Make sure source code is in unix formatting & Download Fyyre's wnet_build script:
    https://forum.ragezone.com/f967/mana...260-a-1196062/


    *Look at the steps to disable the mole explained by Fyyre:
    https://forum.ragezone.com/f967/mana...62/index2.html

    *In this thread Fyyre gives information about FW Exploitation in a post:
    https://forum.ragezone.com/f967/shar...74/index2.html

    *How to make in-game mail sent instantly:
    https://forum.ragezone.com/f784/inst...veryd-1197851/
    ->Overall, the delay does prevent cheating as stated by Bola.

    *This thread hold insights and basics about skills that are helpful for beginners:
    https://forum.ragezone.com/f784/skil...earch-1200219/

    ---Tips to make your own compiler?
    *When you use the VMware Machine wizard,use the option "I will install the operating system later"




    *It's advised to use Host-only networking or internal network.
    ->It's risky to connect to internet with Fedora Core 2.

    *After you mount the FC2-i386-DVD.iso ,It's a waste of time to test the CD before installing the Operating System.
    *It's necessary to use Server Workstation on Chinese Simplified languaged and install Development tools which are necessary to compile the binaries!
    Otherwise you will have issues with encoding and chinese characters and other bugs.




    ---How to set permissions recursively using winscp?
    1)select all files or folder and set permissions to 0755 and right click on the folder.
    2)Click on Properties.
    3)Set the permission to 0755 like this:


    ---Server Binaries:
    There are multiple binaries that can be obtained depending on the folder:

    I-Wnet:
    *logservice
    *toplist
    *backdbd
    *gamedbd.wdb
    *gdeliveryd[game delivery daemon]
    *glinkd[game link daemon]
    *gqueryd[It's used for world era,bid guild base rifts and auction house]
    *unamed or uniquenamed[uniquename daemon it manage names for toons guilds etc..]
    II-wskill:
    ->it helps you compile libskill.so which is necessary to be able to compile the gs.
    III-wgame:
    *libtask.so
    *gs[game server?]

    ---Server Libs:
    I-wnet: {iowlibs & qtoplist}
    II-wgame{collision & pathfinding}
    ->It's all thanks to Gothic and his generosity before he quit.

    Libs necessary to compile FW server source:
    https://drive.google.com/drive/folde...Zd?usp=sharing

    ---How to fix and compile gqueryd[Milos,Mistigri,Gothic]:
    can_auction.h lists the structures that contains items that can be put in auction house.
    1)Download can_auction.h for v305 from here:
    https://drive.google.com/file/d/1V3G...ew?usp=sharing

    2)You could just edit the makefile in wnet/gqueryd by:
    *Removing the use of the gen_can_auction.
    *Making sure the file doesn't get deleted with "make clean"
    ->In order to use on earlier version just remove structures that don't exist in that version.

    ---Useful Commands for server Compiler:

    Code:
    #change keyboard type[It only works if multiple languages are installed]:
    system-config-keyboard
    
    #Directory Commands:
    cd root
    cd /root/FW/wnet
    
    #Go previous directory:
    cd .. 
    
    #Run a file or script:
    ./rpcgen
    
    #Compile:
    make clean
    make 
    
    #Clear the screen:
    clear
    
    #Create logs:
    make >& /root/FW/logs/gdeliveryd.log
    
    #Change CVS address to 127.0.0.1 [Milos's fix]:
    grep -Iirl ":.*@.*[0-9]/" . | xargs sed -i 's/10.68.20.56:/127.0.0.1:/g'
    
    #Copy files:
    cp /root/FW/wgame/gs/libtask.so /root/FW/output
    
    #install package name
    yum install pcre-devel
    
    #Search for a package
    yum search pcre
    ->We copy libtask.so from the following directory /root/FW/wgame/gs into /root/FW/output
    ->You can use comand to copy libskill from wskil to wgame/gs as you will eventually need libskill to be in that folder to compile gs.

    --Cert patch in gdeliveryd[Friend's fix]:
    Gdeliveryd wont work without that cert editing Because the auth we use is mysql db.
    ->just edit certanswer.hpp and comment the following lines
    Code:
        virtual    void Process(Manager *manager, Manager::Session::ID sid)
        {
            LOG_TRACE("receive CertAnswer from au ok,zoneid=%d,aid=%d",GDeliveryServer::GetInstance()->zoneid,GDeliveryServer::GetInstance()->aid);
            GAuthClient *acm = GAuthClient::GetInstance();
            //if(acm->bl_keepalive) return;
            gdeliverd::Cert cert((unsigned char*)authd_cert.begin(), authd_cert.size());
    //        if (cert.VerifyCert() == 0){
    //            GNET::Log::log(LOG_ERR,"Error to verify the cert");
    //            exit(-1);
    //        }
    
    //        if (cert.VerifyCertByCA() == 0){
    //            GNET::Log::log(LOG_ERR,"Error to verify the cert by CA");
    //            exit(-1);
    //        }
    ---Fix gdeliveryd error due to Pcre:


    Method 1:
    upload pcre-4.5-2.src.rpm from FC2-i386-SRPMS-disc1 into /usr/src/redhat/SRPMS

    You will use the following commands
    Code:
    cd /usr/src/redhat/SRPMS
    rpm -vv -Uvh pcre-4.5-2.src.rpm
    
    cd /usr/src/redhat/SPECS
    rpmbuild -ba pcre.spec
    
    cd /usr/src/redhat/BUILD
    ./configure
    make
    make install
    Don't forget to copy pcre.h and pcreposix.h from /usr/src/redhat/BUILD/pcre-4.5 to /usr/include/pcre
    This method isn't a good choice.It's the first method I came up with.

    Method 2:
    1)Modify yum repository and make it use the Fedora archive website
    Source ->https://forums.fedoraforum.org/showthread.php?221471-Repository-configuration-for-older-Fedora-releases
    2)Make sure your FC2 is connected to network until you install the needed packages then go back to host-only network.
    3)Make sure all pcre packages are installed properly for gdeliveryd to compile.
    Code:
    yum install pcre
    yum install pcre-devel


    This is the best method I have came up with to install packages properly while ensuring the right dependencies are installed in this old FC2 Operating system.



    I have to thank the people who helped me advance in my work this summer and gave me support.
    Last edited by Mistigri; 10-04-22 at 01:29 AM.


  2. #2
    Account Upgraded | Title Enabled! Milos is offline
    MemberRank
    Nov 2015 Join Date
    127.0.0.1Location
    281Posts

    Re: FW Server Source Research.

    for some reason the like button isn't working after the latest firefox update, i just logged in with chrome to like a few posts including this one from mist

  3. #3
    Valued Member Mistigri is offline
    MemberRank
    Oct 2020 Join Date
    Forsaken WorldLocation
    120Posts

    Re: FW Server Source Research.

    *unamed is broken by default in all server sources because dbmerge.cpp "PRID64" has to be changed to lld
    Code:
    printf("roleid=%"PRId64" not in map\n", roleid);
    printf("roleid=%lld not in map\n", roleid);
    *Rules.make in wgame must be changed into
    Code:
    HOME=/root/XXX
    IOPATH=$(HOME)/wnet/iowlib
    BASEPATH=$(HOME)/wgame
    *I have added my mknow.sh script in my Server compiler.It can compile any version through editing the HOME directory.It's based on Fyyre's wnet build script and a Friend's script.
    Code:
    #!/bin/bash
    HOME=/root/br20160114
    
    cd $HOME/wnet
    chmod +x rpcgen
    chmod +x rpc/xmlcoder.pl
    chmod +x gamedbd/dbtypesgen.pl
    chmod +x gamedbd/dbdetachgen.pl
    chmod +x gqueryd/can_auction_gen.sh
    chmod +x gqueryd/dumpgen.pl
    chmod +x mkiowlib
    rm gqueryd/include/libcommon.a
    ln -s $HOME/wgame/libcommon.a gqueryd/include/libcommon.a
    
    if [ ! -d $HOME/server-fw/ ]; then
    mkdir $HOME/server-fw/
    mkdir $HOME/server-fw/logs
    mkdir $HOME/server-fw/gdeliveryd
    mkdir $HOME/server-fw/gamedbd
    mkdir $HOME/server-fw/backdbd
    mkdir $HOME/server-fw/uniquenamed
    mkdir $HOME/server-fw/glinkd
    mkdir $HOME/server-fw/gqueryd
    mkdir $HOME/server-fw/gamed
    mkdir $HOME/server-fw/logservice
    fi
    ./rpcgen
    
    
    echo "COMMON..."
    cd $HOME/wnet/common
    make clean
    make &>  $HOME/server-fw/logs/1_Common.log
    
    echo "PERF..."
    cd $HOME/wnet/perf
    make clean
    make &>  $HOME/server-fw/logs/2_perf.log
    
    echo "IO..."
    cd $HOME/wnet/io
    make clean
    make &>  $HOME/server-fw/logs/3_io.log
    make lib &>  $HOME/server-fw/logs/3_io_Lib.log
    
    echo "===GAMEDBD..."
    cd $HOME/wnet/gamedbd
    make clean
    make &> $HOME/server-fw/logs/4_gamedbd.log
    cp $HOME/wnet/gamedbd/gamedbd.wdb $HOME/server-fw/gamedbd/
    echo "=== Done! ==="
    
    echo "===BACKDBD..."
    cd $HOME/wnet/backdbd
    make clean >/devnull 2>&1
    make &>  $HOME/server-fw/logs/5_backdbd.log
    cp $HOME/wnet/backdbd/backdbd $HOME/server-fw/backdbd/
    echo "=== Done! ==="
    
    echo "===GDELIVERYD..."
    cd $HOME/wnet/gdeliveryd
    make clean
    make &>  $HOME/server-fw/logs/6_gdeliveryd.log
    cp $HOME/wnet/gdeliveryd/gdeliveryd $HOME/server-fw/gdeliveryd/
    echo "=== Done! ==="
    
    echo "===GLINKD..."
    cd $HOME/wnet/glinkd
    make clean
    make &>  $HOME/server-fw/logs/7_glinkd.log
    cp $HOME/wnet/glinkd/glinkd $HOME/server-fw/glinkd/
    echo "=== Done! ==="
    
    echo "===GQUERYD..."
    cd $HOME/wnet/gqueryd
    make clean
    make &>  $HOME/server-fw/logs/8_gqueryd.log
    cp $HOME/wnet/gqueryd/gqueryd $HOME/server-fw/gqueryd/
    echo "=== Done! ==="
    
    
    echo "generate logclient ..."
    cd $HOME/wnet/logclient
    make clean
    make -f Makefile.gs &>  $HOME/server-fw/logs/9_logclient.log
    echo "=== Done! ==="
    
    echo "GAMED ..."
    cd $HOME/wnet/gamed
    make clean
    make &>  $HOME/server-fw/logs/10_gamed.log
    make lib &>  $HOME/server-fw/logs/10_gamed_lib.log
    echo "=== Done! ==="
    
    echo "GDBCLIENT ..."
    cd $HOME/wnet/gdbclient
    make clean
    make &>  $HOME/server-fw/logs/11_gdbclient.log
    echo "=== Done! ==="
    
    echo "STORAGE ..."
    cd $HOME/wnet/storage
    make clean
    make &>  $HOME/server-fw/logs/12_storage.log
    make lib &>  $HOME/server-fw/logs/12_storage_Lib.log
    echo "=== Done! ==="
    
    echo "SHM..."
    cd $HOME/wnet/shm
    make clean
    make &>  $HOME/server-fw/logs/13_shm.log
    echo "=== Done! ==="
    
    echo "===QTOPLIST..."
    cd $HOME/wnet/qtoplist
    make clean
    make &>  $HOME/server-fw/logs/14_qtoplist.log
    cp $HOME/wnet/qtoplist/toplist $HOME/server-fw/gamed/
    echo "=== Done! ==="
    
    echo "===UNIQUENAMED..."
    cd $HOME/wnet/unamed
    make clean
    make &>  $HOME/server-fw/logs/15_uniquenamed.log
    cp $HOME/wnet/unamed/unamed $HOME/server-fw/uniquenamed/
    echo "=== Done! ==="
    
    echo "===LOGSERVICE..."
    cd $HOME/wnet/logservice
    make clean
    make &>  $HOME/server-fw/logs/16_logservice.log
    cp $HOME/wnet/logservice/logservice $HOME/server-fw/logservice/
    echo "=== Done! ==="
    
    echo "Create iowlibs ..."
    cd $HOME/wnet
    ./mkiowlib
    echo "=== Done! ==="
    
    echo "Make iowlibs ..."
    cd $HOME/wnet/io
    make lib
    cd $HOME/wnet/gamed
    make lib
    cd $HOME/wnet/storage
    make lib 
    make clean
    
    echo "Make Libgs ..."
    cd $HOME/wgame/libgs
    make clean
    make &>  $HOME/server-fw/logs/17_libgs.log
    
    echo "===LIBSKILL..."
    cd $HOME/wskill/skill
    make clean
    make &>  $HOME/server-fw/logs/18_libskill.log
    cp $HOME/wskill/skill/libskill.so $HOME/wgame/gs
    cp $HOME/wskill/skill/libskill.so $HOME/server-fw/gamed/
    echo "=== Done! ==="
    
    echo "===GS..."
    cd $HOME/wgame
    cd gs
    make clean
    make &>  $HOME/server-fw/logs/19_gs.log
    cp $HOME/wgame/gs/gs $HOME/server-fw/gamed/
    cp $HOME/wgame/gs/libtask.so $HOME/server-fw/gamed/
    echo "=== Done! ==="
    In my new Compiler can_auction.h got generated properly without that fix on gqueryd.
    However this VM is very sensitive.Installing a new package has a chance to break stuff.

    I hope this will be of help to beginners who want to learn how to compile FW server sources for the fun.
    Last edited by Mistigri; 10-04-22 at 01:51 AM.



Advertisement