Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Perfect World 1.5.1 Server Setup SIMPLIFIED

Junior Spellweaver
Joined
Jan 22, 2012
Messages
197
Reaction score
42
added english translation of the default registration script.
 
Newbie Spellweaver
Joined
May 3, 2015
Messages
5
Reaction score
0
sir is this still alive? please update. im using ubuntu 14.04 and i'm stock at

3.3. Put a password on the MySQL ("PasswdForMySQL") the following files: ( add your password to these files)

Code:
etc/table.xml
/var/www/curl_reg.php

for table .xml find (put your user and pass in the place of the X's should be near the top of the page)

Code:
<connection name="auth0" poolsize="3" url="jdbc:mysql://localhost:3306/pw?useUnicode=true&characterEncoding=ascii&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true" username="XXXXXX" password="XXXXXXX"/>


. Execute commands: this will start the server the first time


Code:
cd /home; chmod 777 chmod.sh; ./chmod.sh
./server start


when i enter those code it says permission denied and also for the chmod 77 file directory not found please reply thank you
 
Newbie Spellweaver
Joined
May 3, 2015
Messages
5
Reaction score
0
so what do i do please? i already did download using wget on mediafire. pwserverfile and did the tar xvzf pwservfile. what will i do next please? i'm redownloading again the pwserverfile in case my last download is corrupted. because when i use winscp there is no file in /home but the username. please help.

this is the last line when i type tar xvzf pwserverfile1.5.1v101.tar.gz
crucifix - Perfect World 1.5.1 Server Setup SIMPLIFIED - RaGEZONE Forums

and when i type the next type i came up to this what shall i do please.

crucifix - Perfect World 1.5.1 Server Setup SIMPLIFIED - RaGEZONE Forums
 
Last edited:
Junior Spellweaver
Joined
Dec 28, 2008
Messages
114
Reaction score
13
From what I can tell, you did everything in the "root" directory.
Since you are logging in as root, you are by default in root's user directory and not the actual root of the drive, so you need to do:
cd /
and then do your wget and everything else.
BTW, you can delete the folders you now have inside the "root" folder, since that is where it placed everything from your previous attempts
 
Newbie Spellweaver
Joined
May 3, 2015
Messages
5
Reaction score
0
thx sir i already did do that but now i started the server with ./server start and i am stuck with this


crucifix - Perfect World 1.5.1 Server Setup SIMPLIFIED - RaGEZONE Forums
 
Last edited:
Newbie Spellweaver
Joined
May 18, 2015
Messages
13
Reaction score
3
I followed the guide correctly and everything seems to work just fine. My problem is that when I log it I can't create a character because the "Create" Button won't work it appears to be off some how. Anyone know the fix for this?
 
Junior Spellweaver
Joined
Nov 18, 2012
Messages
133
Reaction score
23
@Gorki
i think you are using ubuntu 14 and bit 64
you need bit 64 fix for it look at the top of the tutorial you will be able to see about it.
lionheart0708
did you config it correct? i mean .pwadminconfig.jsp
 
Initiate Mage
Joined
Aug 25, 2015
Messages
1
Reaction score
0
Compiled server setup guide.

Disclaimer: Notice to all users. I have attempted to credit everyone who's material was used in this guide. None the less I have gone over a large amount of material and downloaded gigs of scripts. If you see something that is yours and want to be credited in the guide. Let me know via pm and send me a link to the original thread where you submitted it and I will get you added in a timely fashion.

Ok most of this content is not my own and I will be crediting the various authors where their content has been used. The purpose of this guide is to simplify installing a 1.5.1 perfect world server. I spent several days searching stuff and I would like to hopefully save a few people the trouble.


Tips

About the skype you guys can pm me on here and ask to add me. I will on a limited basis due to my time constraints attempt to help you. That said keep it out of the thread I want to focus this on improving the guide and getting input from the great devs here to make things easier on you guys.

I built this on 64bit Debian but I am fairly sure it works on ubuntu so if you use the guide let me know.

Note my own domain name is used in the examples here. You can replace it with either your domain name if its accessible or the ip address of your server.

A lot of the errors you guys are having with pw admin are cause by the directories and start scripts not being chmoded you need to do a recursive chmod on them. They are in the home dir just hidden. I think to see them at least in debian you can use ls-a from your home directory once you know the directory names do a recursive chmod on them. Note you prolly have to list the directory as ./directory or file name in the command. This can be accomplished like this from the home directory or whatever your server dir is chmod -R 777 folder or file name here
I dont recommend 777 maybe 775 but that should fix a lot of the not starting issues and crashes. Ok if all of the others fail do this go to your home directory and use this command
chmod -R 775 . if it doesn't work do 777 .. that will chmod every file in the home directory and your pwadmin should fire up.
Basics

Ok some basics before you start. Number one dont edit files like .sh and such for a linux server with a windows text editor it messes with the encoding and a lot of the scripts wont run wen you save them. I use its a good free ftp client with command execution abilities for extracting files and stuff. The editor it uses wont mess your files up either.

Installing the server
.
Content by user MrKiller

1. Installing packages (install these packages first)

Code:
apt-get update
apt-get install openjdk-6-jre
apt-get install apache2
apt-get install mysql-server
apt-get install php5
apt-get install php5-mysql
apt-get install php5-curl
apt-get install phpmyadmin

For x64: (if you use a 64 bit os install this )

Code:
dpkg --add-architecture i386
apt-get update
apt-get install ia32-libs

For Ubuntu 14 64bit do this instead.

correct fix for ubuntu 14.04 on 64bit:

- when installing the x64 libs you will get an error and it suggests 3 diff libs instead
- install the 3 suggest libs with apt-get install
- also install "apt-get install libstdc++6:i386"
- and "apt-get install libxml2:i386" (this is for gacd failing to start)

If you cant access phpmyadmin
Code:
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
sudo /etc/init.d/apache2 reload
some users will need the sudo in the command some wont. This merges the apache and phpmyadmin configs letting apache find it.

2. Creating a DataBase ( setting up your mysql)

2.1. Go to phpmyadmin
2.2. Go to tab SQL
2.3. Paste the contents of Sql for pw.sql in the field and click OK. ( You may also be able to use the import function)

A lot of you guys are having issues with the copy paste. I suggest downloading the file and using the import option in phpmyadmin to create your db. Less hassle that way.

SQL for copy paste

Code:
SET NAMES utf8;
SET foreign_key_checks = 0;
SET time_zone = 'SYSTEM';
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
CREATE DATABASE pw CHARACTER SET utf8 COLLATE utf8_general_ci;
DELIMITER ;

use pw;

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

DROP TABLE IF EXISTS `auth`;
CREATE TABLE IF NOT EXISTS `auth` (
  `userid` int(11) NOT NULL default '0',
  `zoneid` int(11) NOT NULL default '0',
  `rid` int(11) NOT NULL default '0',
  PRIMARY KEY  (`userid`,`zoneid`,`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `forbid`;
CREATE TABLE IF NOT EXISTS `forbid` (
  `userid` int(11) NOT NULL default '0',
  `type` int(11) NOT NULL default '0',
  `ctime` datetime NOT NULL,
  `forbid_time` int(11) NOT NULL default '0',
  `reason` blob NOT NULL,
  `gmroleid` int(11) default '0',
  PRIMARY KEY  (`userid`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `iplimit`;
CREATE TABLE IF NOT EXISTS `iplimit` (
  `uid` int(11) NOT NULL default '0',
  `ipaddr1` int(11) default '0',
  `ipmask1` varchar(2) default '',
  `ipaddr2` int(11) default '0',
  `ipmask2` varchar(2) default '',
  `ipaddr3` int(11) default '0',
  `ipmask3` varchar(2) default '',
  `enable` char(1) default '',
  `lockstatus` char(1) default '',
  PRIMARY KEY  (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `point`;
CREATE TABLE IF NOT EXISTS `point` (
  `uid` int(11) NOT NULL default '0',
  `aid` int(11) NOT NULL default '0',
  `time` int(11) NOT NULL default '0',
  `zoneid` int(11) default '0',
  `zonelocalid` int(11) default '0',
  `accountstart` datetime default NULL,
  `lastlogin` datetime default NULL,
  `enddate` datetime default NULL,
  PRIMARY KEY  (`uid`,`aid`),
  KEY `IX_point_aidzoneid` (`aid`,`zoneid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `usecashlog`;
CREATE TABLE IF NOT EXISTS `usecashlog` (
  `userid` int(11) NOT NULL default '0',
  `zoneid` int(11) NOT NULL default '0',
  `sn` int(11) NOT NULL default '0',
  `aid` int(11) NOT NULL default '0',
  `point` int(11) NOT NULL default '0',
  `cash` int(11) NOT NULL default '0',
  `status` int(11) NOT NULL default '0',
  `creatime` datetime NOT NULL,
  `fintime` datetime NOT NULL,
  KEY `IX_usecashlog_creatime` (`creatime`),
  KEY `IX_usecashlog_uzs` (`userid`,`zoneid`,`sn`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `usecashnow`;
CREATE TABLE IF NOT EXISTS `usecashnow` (
  `userid` int(11) NOT NULL default '0',
  `zoneid` int(11) NOT NULL default '0',
  `sn` int(11) NOT NULL default '0',
  `aid` int(11) NOT NULL default '0',
  `point` int(11) NOT NULL default '0',
  `cash` int(11) NOT NULL default '0',
  `status` int(11) NOT NULL default '0',
  `creatime` datetime NOT NULL,
  PRIMARY KEY  (`userid`,`zoneid`,`sn`),
  KEY `IX_usecashnow_creatime` (`creatime`),
  KEY `IX_usecashnow_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
  `ID` int(11) NOT NULL default '0',
  `name` varchar(32) NOT NULL default '',
  `passwd` varchar(64) NOT NULL,
  `Prompt` varchar(32) NOT NULL default '',
  `answer` varchar(32) NOT NULL default '',
  `truename` varchar(32) NOT NULL default '',
  `idnumber` varchar(32) NOT NULL default '',
  `email` varchar(64) NOT NULL default '',
  `mobilenumber` varchar(32) default '',
  `province` varchar(32) default '',
  `city` varchar(32) default '',
  `phonenumber` varchar(32) default '',
  `address` varchar(64) default '',
  `postalcode` varchar(8) default '',
  `gender` int(11) default '0',
  `birthday` datetime default NULL,
  `creatime` datetime NOT NULL,
  `qq` varchar(32) default '',
  `passwd2` varchar(64) default NULL,
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `IX_users_name` (`name`),
  KEY `IX_users_creatime` (`creatime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DELIMITER $$

use pw$$



CREATE PROCEDURE `acquireuserpasswd`(in name1 VARCHAR(64), out uid1 INTEGER, out passwd1 VARCHAR(64))
BEGIN
    SELECT id, passwd INTO uid1, passwd1 FROM users WHERE name = name1;
END$$



CREATE PROCEDURE `addForbid`(in userid1 INTEGER, in type1 INTEGER, in forbid_time1 INTEGER, in reason1 BINARY(255), in gmroleid1 INTEGER)
BEGIN
 DECLARE rowcount INTEGER;
  START TRANSACTION;
    UPDATE forbid SET ctime = now(), forbid_time = forbid_time1, reason = reason1, gmroleid = gmroleid1 WHERE userid = userid1 AND type = type1;
    SET rowcount = ROW_COUNT();
    IF rowcount = 0 THEN
      INSERT INTO forbid VALUES(userid1, type1, now(), forbid_time1, reason1, gmroleid);
    END IF;
  COMMIT;
END$$



CREATE PROCEDURE `addGM`(in userid INTEGER, in zoneid INTEGER)
BEGIN
  DECLARE x INTEGER;
  START TRANSACTION;
    SET x = 0;
    WHILE x < 12 DO
      INSERT INTO auth VALUES (userid, zoneid, x);
      SET x = x + 1;
    END WHILE;
    SET x = 100;
    WHILE x < 106 DO
      INSERT INTO auth VALUES (userid, zoneid, x);
      SET x = x + 1;
    END WHILE;
    SET x = 200;
    WHILE x < 215 DO
      INSERT INTO auth VALUES (userid, zoneid, x);
      SET x = x + 1;
    END WHILE;
    SET x = 500;
    WHILE x < 519 DO
      INSERT INTO auth VALUES (userid, zoneid, x);
      SET x = x + 1;
    END WHILE;
  COMMIT;
END$$

CREATE PROCEDURE `adduser`(
  in name1 VARCHAR(64),
  in passwd1 VARCHAR(64),
  in prompt1 VARCHAR(32),
  in answer1 VARCHAR(32),
  in truename1 VARCHAR(32),
  in idnumber1 VARCHAR(32),
  in email1 VARCHAR(32),
  in mobilenumber1 VARCHAR(32),
  in province1 VARCHAR(32),
  in city1 VARCHAR(32),
  in phonenumber1 VARCHAR(32),
  in address1 VARCHAR(64),
  in postalcode1 VARCHAR(8),
  in gender1 INTEGER,
  in birthday1 VARCHAR(32),
  in qq1 VARCHAR(32),
  in passwd21 VARCHAR(64)
)
BEGIN
  DECLARE idtemp INTEGER;
    SELECT IFNULL(MAX(id), 16) + 16 INTO idtemp FROM users;
    INSERT INTO users (id,name,passwd,prompt,answer,truename,idnumber,email,mobilenumber,province,city,phonenumber,address,postalcode,gender,birthday,creatime,qq,passwd2) VALUES( idtemp, name1, passwd1, prompt1, answer1, truename1, idnumber1, email1, mobilenumber1, province1, city1, phonenumber1, address1, postalcode1, gender1, birthday1, now(), qq1, passwd21 );
END$$



CREATE PROCEDURE `adduserpoint`(in uid1 INTEGER, in aid1 INTEGER, in time1 INTEGER)
BEGIN
 DECLARE rowcount INTEGER;
 START TRANSACTION;
    UPDATE point SET time = IFNULL(time,0) + time1 WHERE uid1 = uid AND aid1 = aid;
    SET rowcount = ROW_COUNT();
    IF rowcount = 0 THEN
      INSERT INTO point (uid,aid,time) VALUES (uid1,aid1,time1);
    END IF;
  COMMIT;
END$$

CREATE PROCEDURE `addUserPriv`(in userid INTEGER, in zoneid INTEGER, in rid INTEGER)
BEGIN
  START TRANSACTION;
    INSERT INTO auth VALUES(userid, zoneid, rid);
  COMMIT;
END$$

CREATE PROCEDURE `changePasswd`(in name1 VARCHAR(64), in passwd1 VARCHAR(64))
BEGIN
  START TRANSACTION;
    UPDATE users SET passwd = passwd1 WHERE name = name1;
  COMMIT;
END$$

CREATE PROCEDURE `changePasswd2`(in name1 VARCHAR(64), in passwd21 VARCHAR(64))
BEGIN
  START TRANSACTION;
    UPDATE users SET passwd2 = passwd21 WHERE name = name1;
  COMMIT;
END$$

CREATE PROCEDURE `clearonlinerecords`(in zoneid1 INTEGER, in aid1 INTEGER)
BEGIN
  START TRANSACTION;
    UPDATE point SET zoneid = NULL, zonelocalid = NULL WHERE aid = aid1 AND zoneid = zoneid1;
  COMMIT;
END$$

CREATE PROCEDURE `deleteTimeoutForbid`(in userid1 INTEGER)
BEGIN
  START TRANSACTION;
    DELETE FROM forbid WHERE userid = userid1 AND timestampdiff(second, ctime, now()) > forbid_time;
  COMMIT;
END$$

CREATE PROCEDURE `delUserPriv`(in userid1 INTEGER, in zoneid1 INTEGER, in rid1 INTEGER, in deltype1 INTEGER)
BEGIN
START TRANSACTION;
  IF deltype1 = 0 THEN
    DELETE FROM auth WHERE userid = userid1 AND zoneid = zoneid1 AND rid = rid1;
  ELSE
    IF deltype1 = 1 THEN
      DELETE FROM auth WHERE userid = userid1 AND zoneid = zoneid1;
    ELSE
      IF deltype1 = 2 THEN
        DELETE FROM auth WHERE userid = userid1;
      END IF;
    END IF;
  END IF;
COMMIT;
END$$

CREATE PROCEDURE `enableiplimit`(in uid1 INTEGER, in enable1 CHAR(1))
BEGIN
  DECLARE rowcount INTEGER;
  START TRANSACTION;
  UPDATE iplimit SET enable=enable1 WHERE uid=uid1;
  SET rowcount = ROW_COUNT();
  IF rowcount = 0 THEN
    INSERT INTO iplimit (uid,enable) VALUES (uid1,enable1);
  END IF;
  COMMIT;
END$$

CREATE PROCEDURE `lockuser`(in uid1 INTEGER, in lockstatus1 CHAR(1))
BEGIN
  DECLARE rowcount INTEGER;
  START TRANSACTION;
  UPDATE iplimit SET lockstatus=lockstatus1 WHERE uid=uid1;
  SET rowcount = ROW_COUNT();
  IF rowcount = 0 THEN
    INSERT INTO iplimit (uid,lockstatus,enable) VALUES (uid1,lockstatus1,'t');
  END IF;
  COMMIT;
END$$

CREATE PROCEDURE `recordoffline`(in uid1 INTEGER, in aid1 INTEGER, inout zoneid1 INTEGER, inout zonelocalid1 INTEGER, inout overwrite1 INTEGER)
BEGIN
  DECLARE rowcount INTEGER;
  START TRANSACTION;
    UPDATE point SET zoneid = NULL, zonelocalid = NULL WHERE uid = uid1 AND aid = aid1 AND zoneid = zoneid1;
    SET rowcount = ROW_COUNT();
    IF overwrite1 = rowcount THEN
      SELECT zoneid, zonelocalid INTO zoneid1, zonelocalid1 FROM point WHERE uid = uid1 AND aid = aid1;
    END IF;
  COMMIT;
END$$

CREATE PROCEDURE `recordonline`(in uid1 INTEGER, in aid1 INTEGER, inout zoneid1 INTEGER, inout zonelocalid1 INTEGER, inout overwrite INTEGER)
BEGIN
  DECLARE tmp_zoneid INTEGER;
  DECLARE tmp_zonelocalid INTEGER;
  DECLARE rowcount INTEGER;
  START TRANSACTION;
    SELECT SQL_CALC_FOUND_ROWS zoneid, zonelocalid INTO tmp_zoneid, tmp_zonelocalid FROM point WHERE uid = uid1 and aid = aid1;
    SET rowcount = FOUND_ROWS();
    IF rowcount = 0 THEN
      INSERT INTO point (uid, aid, time, zoneid, zonelocalid, lastlogin) VALUES (uid1, aid1, 0, zoneid1, zonelocalid1, now());
    ELSE IF tmp_zoneid IS NULL OR overwrite = 1 THEN
      UPDATE point SET zoneid = zoneid1, zonelocalid = zonelocalid1, lastlogin = now() WHERE uid = uid1 AND aid = aid1;
    END IF;
    END IF;
    IF tmp_zoneid IS NULL THEN
      SET overwrite = 1;
    ELSE
      SET zoneid1 = tmp_zoneid;
      SET zonelocalid1 = tmp_zonelocalid;
    END IF;
  COMMIT;
END$$

CREATE PROCEDURE `remaintime`(in uid1 INTEGER, in aid1 INTEGER, out remain INTEGER, out freetimeleft INTEGER)
BEGIN
  DECLARE enddate1 DATETIME;
  DECLARE now1 DATETIME;
  DECLARE rowcount INTEGER;
  START TRANSACTION;
  SET now1 = now();
  IF aid1 = 0 THEN
    SET remain = 86313600;
    SET enddate1 = date_add(now1, INTERVAL '30' DAY);
  ELSE
    SELECT time, IFNULL(enddate, now1) INTO remain, enddate1 FROM point WHERE uid = uid1 AND aid = aid1;
    SET rowcount = ROW_COUNT();
    IF rowcount = 0 THEN
      SET remain = 0;
      INSERT INTO point (uid,aid,time) VALUES (uid1, aid1, remain);
    END IF;
  END IF;
  SET freetimeleft = 0;
  IF enddate1 > now1 THEN
    SET freetimeleft = timestampdiff(second, now1, enddate1);
  END IF;
  COMMIT;
END$$

CREATE PROCEDURE `setiplimit`(in uid1 INTEGER, in ipaddr11 INTEGER, in ipmask11 VARCHAR(2), in ipaddr21 INTEGER, in ipmask21 VARCHAR(2), in ipaddr31 INTEGER, in ipmask31 VARCHAR(2), in enable1 CHAR(1))
BEGIN
  DECLARE rowcount INTEGER;
  START TRANSACTION;
    UPDATE iplimit SET ipaddr1 = ipaddr11, ipmask1 = ipmask11, ipaddr2 = ipaddr21, ipmask2 = ipmask21, ipaddr3 = ipaddr31, ipmask3 = ipmask31 WHERE uid = uid1;
    SET rowcount = ROW_COUNT();
    IF rowcount = 0 THEN
      INSERT INTO iplimit (uid, ipaddr1, ipmask1, ipaddr2, ipmask2, ipaddr3, ipmask3, enable1) VALUES (uid1, ipaddr11, ipmask11, ipaddr21, ipmask21, ipaddr31, ipmask31,'t');
    END IF;
  COMMIT;
END$$

CREATE PROCEDURE `updateUserInfo`(
  in name1 VARCHAR(32),
  in prompt1 VARCHAR(32),
  in answer1 VARCHAR(32),
  in truename1 VARCHAR(32),
  in idnumber1 VARCHAR(32),
  in email1 VARCHAR(32),
  in mobilenumber1 VARCHAR(32),
  in province1 VARCHAR(32),
  in city1 VARCHAR(32),
  in phonenumber1 VARCHAR(32),
  in address1 VARCHAR(32),
  in postalcode1 VARCHAR(32),
  in gender1 INTEGER,
  in birthday1 VARCHAR(32),
  in qq1 VARCHAR(32)
 )
BEGIN
  START TRANSACTION;
    UPDATE users SET prompt = prompt1, answer = answer1, truename = truename1, idnumber = idnumber1, email = email1, mobilenumber = mobilenumber1, province = province1, city = city1, phonenumber = phonenumber1, address = address1, postalcode = postalcode1, gender = gender1, birthday = birthda1, qq = qq1 WHERE name = name1;
  COMMIT;
END$$

CREATE PROCEDURE `usecash`(
  in userid1 INTEGER,
  in zoneid1 INTEGER,
  in sn1 INTEGER,
  in aid1 INTEGER,
  in point1 INTEGER,
  in cash1 INTEGER,
  in status1 INTEGER,
  out error INTEGER
)
BEGIN
DECLARE sn_old INTEGER;
DECLARE aid_old INTEGER;
DECLARE point_old INTEGER;
DECLARE cash_old INTEGER;
DECLARE status_old INTEGER;
DECLARE createtime_old DATETIME;
DECLARE time_old INTEGER;
DECLARE need_restore INTEGER;
DECLARE exists1 INTEGER;
DECLARE rowcount INTEGER;
START TRANSACTION;
  SET error = 0;
  SET need_restore = 0;
  SELECT SQL_CALC_FOUND_ROWS sn, aid, point, cash, status, creatime INTO sn_old, aid_old, point_old, cash_old, status_old, createtime_old FROM usecashnow WHERE userid = userid1 AND zoneid = zoneid1 AND sn >= 0;
  SET rowcount = FOUND_ROWS();
  IF rowcount = 1 THEN
    SET exists1 = 1;
  ELSE
    SET exists1 = 0;
  END IF;
  IF status1 = 0 THEN
    IF exists1 = 0 THEN
      SELECT aid, point INTO aid1, point1 FROM usecashnow WHERE userid = userid1 AND zoneid = zoneid1 AND sn = sn1;
      SET point1 = IFNULL(point1,0);
      UPDATE point SET time = time-point1 WHERE uid = userid1 AND aid = aid1 AND time >= point1;
      SET rowcount = ROW_COUNT();
      IF rowcount = 1 THEN
        UPDATE usecashnow SET sn = 0, status = 1 WHERE userid = userid1 AND zoneid = zoneid1 AND sn = sn1;
      ELSE
        SET error = -8;
      END IF;
    END IF;
  ELSE
    IF status1 = 1 THEN
      IF exists1 = 0 THEN
        UPDATE point SET time = time-point1 WHERE uid = userid1 AND aid = aid1 AND time >= point1;
        SET rowcount = ROW_COUNT();
        IF rowcount = 1 THEN
          INSERT INTO usecashnow (userid, zoneid, sn, aid, point, cash, status, creatime) VALUES (userid1, zoneid1, sn1, aid1, point1, cash1, status1, now());
        ELSE
          INSERT INTO usecashnow SELECT userid1, zoneid1, IFNULL(min(sn),0)-1, aid1, point1, cash1, 0, now() FROM usecashnow WHERE userid = userid1 AND zoneid = zoneid1 AND 0 >= sn;
          SET error = -8;
        END IF;
      ELSE
        INSERT INTO usecashnow SELECT userid1, zoneid1, IFNULL(min(sn),0)-1, aid1, point1, cash1, 0, now() FROM usecashnow WHERE userid = userid1 AND zoneid = zoneid1 AND 0 >= sn;
        SET error = -7;
      END IF;
    ELSE
      IF status1 = 2 THEN
        IF exists1 = 1 AND status_old = 1 AND sn_old = 0 THEN
          UPDATE usecashnow SET sn = sn1, status = status1 WHERE userid = userid1 AND zoneid = zoneid1 AND sn = sn_old;
        ELSE
          SET error = -9;
        END IF;
      ELSE
        IF status1 = 3 THEN
           IF exists1 = 1 AND status_old = 2 THEN
            UPDATE usecashnow SET status = status1 WHERE userid = userid1 AND zoneid = zoneid1 AND sn = sn_old;
           ELSE
            SET error = -10;
            END IF;
        ELSE
         IF status1 = 4 THEN
          IF exists1 = 1 THEN
            DELETE FROM usecashnow WHERE userid = userid1 AND zoneid = zoneid1 AND sn = sn_old;
            INSERT INTO usecashlog (userid, zoneid, sn, aid, point, cash, status, creatime, fintime) VALUES (userid1, zoneid1, sn_old, aid_old, point_old, cash_old, status1, createtime_old, now());
          END IF;
          IF NOT (exists1 = 1 AND status_old = 3) THEN
            SET error = -11;
          END IF;
        ELSE
          SET error = -12;
        END IF;
      END IF;
    END IF;
  END IF;
  END IF;
  IF need_restore = 1 THEN
    UPDATE point SET time = time+point_old WHERE uid = userid1 AND aid = aid_old;
    DELETE FROM usecashnow WHERE userid = userid1 AND zoneid = zoneid1 AND sn = sn_old;
    INSERT INTO usecashlog (userid, zoneid, sn, aid, point, cash, status, creatime, fintime) VALUES (userid1, zoneid1, sn_old, aid_old, point_old, cash_old, status1, createtime_old, now());
  END IF;
COMMIT;
END$$

2.4. If does not work phpmyadmin, run the following commands:

Code:
ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d
apache2ctl restart

3. Working with Files

3.1. Open console
3.2. Execute the command:

Code:
cd /
wget "http://havenrepo.com/Downloads/pw151/server/PWServerFiles151v101.tar.gz"
tar xvzf PWServerFiles1.5.1v101.tar.gz

If the original link is down use mine

Here is an english translated version of the default registration script for those who want it.

3.3. Put a password on the MySQL ("PasswdForMySQL") the following files: ( add your password to these files)

Code:
etc/table.xml
/var/www/curl_reg.php

for table .xml find (put your user and pass in the place of the X's should be near the top of the page)

Code:
<connection name="auth0" poolsize="3" url="jdbc:mysql://localhost:3306/pw?useUnicode=true&characterEncoding=ascii&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true" username="XXXXXX" password="XXXXXXX"/>

for curl_reg.php the file is clearly formated no just open it youl see it.

3.4. Execute commands: this will start the server the first time


Code:
cd /home; chmod 777 chmod.sh; ./chmod.sh
./server start

Script commands

./server start - start the server
./server stop - stop the server
./server restart - restart the server
./server getlog - get a log

Make sure the map is62 is started otherwise you wont be able to log in.

Command to start maps

Code:
cd /home/gamed; ./gs gs01

change gs01 for the id of the map you want to start is62 for the begginers place you need to login.


Oh the registration.php /var/www is in another language you can open it up and edit the texts. Here is a link to that translates the stuff you need to register just upload it and replace the old file.

Original thread link

by user Psytrac



Using this client I had no issues make sure you update the file serverlist in element/userdata/server mine is a bit trimmed down but I will post examples. just change my links for yours. I recommend editing the stock one just so you get to learn. Also edit the patcherfiles serverlist and update server in patcher/server before launching .. Do not run it before doing this even if you close it before it finishes the first file loaded will cause you to get a version too low error.

element serverlist will look like this

Code:
Server1
Haven    29000:havenpwi.com        93


the patchers

serverlist

Code:
Server 1
[Havenpw - PvE] Tyrael          29000:havenpwi.com    54

updateserver

Code:
"[EN]Patch-1"        "http://havenpwi.com"

( I will re mirror the client when I have a chance dont have time for a 8 gig upload right now. )

original thread.

pwAdmin

Now this was the fun part I am going to help you setup pwAdmin

script (use this ) script by sora1984

original thread

Code:
cd to /

create a new file call it pwadmin.sh paste this into it:

Code:
#!/bin/bash
#noob installer lol

ip=`/sbin/ifconfig|grep inet|head -1|sed 's/\:/ /'|awk '{print $3}'`

apt-get install -y unzip tomcat7
cd var/lib/tomcat7/webapps/
service tomcat7 stop
wget https://dl.dropboxusercontent.com/u/19918926/pwadmin1.5.1.zip
unzip -o pwadmin1.5.1.zip
service tomcat7 start
echo ""
echo "Open your browser and go to http://"$ip":8080/pwAdmin/"

Code:
to run it
chmod 755 pwadmin.sh
./pwadmin.sh

optionally here is the just download it upload to the root of your server chmod it to 755 and run using ./pwadmin.sh

Here is a second download link for the actual too.

once that is done. edit the configs in

Code:
var/lib/tomcat7/webapps/pwAdmin/WEB-INF/.pwadminconf.jsp

You also need to change your root password in this file.. if you dont most of the time it wont login. The setting for this is at the top of the file.

Code:
// pwadmin access password as md5 encrypted string
    // default password is[B] root[/B] -> [B]63a9f0ea7bb98050796b649e85481845[/B]
    String iweb_password = "[B]63a9f0ea7bb98050796b649e85481845[/B]";

The bolded word root is your password. The bolded string of numbers (63a9f0ea7bb98050796b649e85481845 )is the md5 hash This has to match like it does above. Decide what your password is going to be and change root to it. Then go though any generator will work and type your new pass in to get the md5 hash remember to replace both of the bolded hashes with the new one.

Note a work around for viewing and editing other peoples chars is to use the addons tab and use gm control open one of the gm chars. Then look in the nav bar you will see their user id in the link change it to the char you wanna view and hit enter itl open that charachter. Other wise in order to fix the characters tab you will need to do the following.



Thanks to abileneken for clueing me in on this,




Gm/debug

The gm console can be reached in game by holding ctrl and pressing G
the debug is reached by holding shift and pressing ~


if you need gm without having pwAdmin setup you can do this like so.

Original content by segredu
original thread

Add GM and Cubi-Coin in MySQL database

1- Open your browser with http:// server IP /phpmyadmin/

2- Select your pw database and select SQL tab
3- ID code code (change 32 for your Char ID) in the codes below and click Execute/submit


ADD GM

Code:
call addGM (32 , 1)


ADD 10.000 CUBI-COIN(Zen/CS gold)

Code:
call usecash (32 , 1, 0, 1, 0, 1000000, 1,                              @[I][B][URL="https://forum.ragezone.com/members/116066.html"]ERROR[/URL][/B][/I])


Gm Console commands Original guide by Bryanek

Original thread

GUIDE - HOW TO USE GM CONSOLE - PERFECT WORLD


GM Commands


Code:
Start invincibility - Makes you invincible, if something attacks you it will show "no effect". This can be turned on/off by double click on this command. It disables by using fury burst

Start Invisibility - Makes you invisible. This can be turned on/off by double click on this command. If you are invisible players can't see you in the party window (T)

Restart server - Restarts the whole server. You can add the number of the seconds before the server shuts down


Broadcast - By pressing on this a new window comes up. By writing in this window you can write in the red (GM) chat


Show online users number - Shows how many players are currently playing on the server

Show/hide character ID - This can be turned on/off by double click on this command. It show the player's IDs instead of their names

Banned speaking account - This function mutes every character that is on the account (have to add ID one of the players char on the account)

Banned speaking character - This function mutes the players character (Have to add the character ID)


Banned sealing account - This function bans the players account so the player cant login with it. (Have to add the players ID, time and reason)


Banned sealing character - This function bans the players character so the player cant login with it. (Have to add the players ID, time and reason)

Jump next to player - After you wrote the players ID it teleport right next to him. If you teleported in the fb, it will count you out like a normal player (60 seconds), (Have to add: ID)

Call player - Teleports the player right next to you (Have to add: ID)


Create monster - You can create monster with this function
You have to add the:
Monsters ID (Cannot be blank),
Exterior ID (0 by default) [Exterior is a place where you can change the skin of a mob]
Quantity (The number how many monster do you want to spawn)
Existing time (How long does the monster lives, default is 0)

WARNING: Some mobs ignores injury, so always give them an existing time or it wont disappear!!!

Activate monster creator - This is where you can make the most of the events.
Type the number of the event and it wil start. You cant add the lenght of the event here. Like on dc event the mobs will spawn automatically.
Some of the events stops by itself (like the dram searching port invasion duration is 1 hour)

[B]ID of Events:[/B]

Christmas Events

2 - Christmas Event (Snowmans in ADC dropping celestial stones etc)
3 - Santa Claus City of Ethersword Elder
4 - Santa Claus City of Feathers Elder
5 - Santa Claus City of Vanished Elder
6 - Santa Claus Rosalind & Eunice in Ancient Dragon City

8 - Activate boxes in arena (GM need to be inside to start)

Horse Race

9 - Reward boxes (At start/finish line)
10 - Flags and start npc (Giant dog)
11 - Cheerleaders (And arrows and bridge)

Communication event

12 - Mailboxes (Default is set to on, remeove them by using Close monster creater)
13 - Messenger Angel Chiling (NPC by all mailboxes selling World Trumpets, and have mailing service), Also adds replacement NPCs for the Perfect Present Ambassadors
14 - Perfect Present Ambassador (Defauld is set to on, remove them by using Close monster creater)

Rancor Event

66 - Village of the Hidden Hero rancor level 20
67 - Cambridge Village rancor level 20
68 - Bamboo Village rancor level 20
69 - Walled Stronghold rancor level 20
70 - Antiquity Entreance rancor level 20
71 - South Stalking Stronghold rancor level 20
72 - Ground of Logging rancor level 20
73 - Vicinage Town rancor level 20
74 - Barbarian Village rancor level 20
75 - Mirror lake rancor level 40
76 - Orchis Sereene rancor level 40
77 - Allied Army Camp rancor level 40
78 - Fishing Village rancor level 40
79 - Clan of haste rancor level 50
80 - Town of Forwarding wind rancor level 50
81 - Camp of Sumor rancor level 50
82 - Sundown Town rancor level 50
83 - Town of arriving rancor level 50
84 - Arrow stepping Manor rancor level 70
85 - City of Misfortune rancor level 70
86 - Fangs Town rancor level 70
87 - Dreaming cloud Village rancor level 70
88 - Whetstone Stronghold rancor level 70
89 - Village of the Lost rancor level 90, flying
90 - Town of Sanctuary rancor level 90, flying
91 - Notting Village rancor level 90, flying
92 - Reckless Beauty Village rancor level 90
93 - Fire bathing Village rancor level 90
94 - South Screen Town rancor level 90
95 - East Screen Town rancor level 90
96 - North Screen Town rancor level 90
97 - Expeditionary Camp rancor level 100
98 - Snowswept Village rancor level 100
99 - Shattered ice rancor level 100
100 - Avalanche rancor level 100
103 - Dream Searching Port invasion
104 - Thousand Stream AIR invasion

ADC invasion events

109 - Start final ADC invasion wave (When bosses are killed it advances onwars to wave 1 and if bosses has been aggroed they dont disappear when event is closed)
110 - Start ADC invasion wave 1
111 - Start ADC invasion wave 2
112 - Start ADC invasion wave 3
113 - Start ADC invasion wave 4
114 - ADC invasion last boss outside ADC north
117 - ADC invasion last boss outside ADC north
118 - ADC invasion last boss outside ADC west
119 - ADC invasion last boss outside ADC south
120 - ADC invasion last boss outside ADC south
121 - ADC invasion last bosse's Leader ADC north
125 - NON-AGGRO Boss inside wall by ADC north gate
126 - General Sorely and a line of guards outside ADC. Usefull for ADC invasion event

New Year events

127 - New Year Lanterns (lamps) on most buildings and 20 lantern NPCs (New Year Riddle lanterns) in ADC center, no quests
128 - New year Boss outside ADC west, north and south which drops fireworks, mirage, ang bao (gives 10-50k gold) and Congratulate token wich gives system announcement "-Player- wishes all the players in the Perfect World a happy and prosperous chineese new year!" Also adds "New Year Gift Peddlery" NPC who sells gift items (No usage/unknown usage of them so far)

Other

134 - Puts boxes around teleporters in Ethersword, Vanished and Feathers

Close monster creator - You have to close every event here after its finished or if you want to restart it. type its number and press confirm

Create object - You can use it to spawn items previously added into "GM spawns" in elements.data

Is setting touched off with conversation - Means you cant be whispered

Banned sealing character in common:

Ban speaking = Mute by character
Ban transaction = Player are not able to use trade option
Ban selling = Player shouldn't be able to sell anything to NPC but it doesn't work, it works like a mute
Seal the character = Ban by character

How to get the ID of players:

1.

In chat clicking on their names with the right mouse button while pressing left CTRL and their number will show up in the middle of the screen.
It not working if the chat is one sided => if you just pm him and try to get his number it will show you 0

2.

Show/hide character ID (detailed above)

How to get the IDs of the monsters:

Go to Perfect World Database and select which mob do you want to spawn.
To spawn it you have the copy the last numbers of the sites URL

Expample:

Mob: Ancient tiger
The sites URL is "http://www.pwdatabase.com/ms/mob/16568"
So the ID of the Ancient tiger is 16568

Dont forget: Watch what mobs are you spawning!

How to teleport freely - Easiest thing ever. Open the map, zoom there where do you want to go and click there with the left mouse button while holding left CTRL. There are some places where you cant move. In GM land you can move freely

Debug consol commands.

Ok some of these I can verify work mostly the ones pretaining to your own character. The rest I would appreciate help verifying so I can update the guide please state how you used them if you post so I can specify.

Note these are FW commands but most of them work in pw. If someone can find a better list of debug commands for 1.5.1 let me know I will update the guide.

Here is the link for the file for element client ( for debug and quick starting) make sure you run it form the element folder in the client. Note you cannot get debut menu without starting the game with this file.

Original Guide by loko9988

Original thread

Code:
Level Up:
d_c2scmd 2000 confirmed level and spirit

d 2000%  same effect as above code confirmed 

GM Weapon:
d_c2scmd 10807 782

GM Armor:
d_c2scmd 10807 5769

GM Pants:
d_c2scmd 10807 15329

GM Shoes:
d_c2scmd 10807 4524 

GM Ring:
d_c2scmd 10807 8851

GM item to warp to instance area:
d_c2scmd 10807 23467

Normal Weapon Codes:
Lv20:31135-31142
Lv30:31143-31150
Lv40:31151-31158
Lv50:31159-31166
Lv60:28323-28326, 28351-28354
Lv70:28331-28334, 28359-28362

Warp to Map Location:
d_c2scmd 2008 <map number> <x> <y>

Gold:
d_c2scmd 1988 10000000000 [amount]

Soul Coins:
d_c2scmd 1989 [amount]

Spawn Item Onto Ground (Use this code to spawn "stacks" of items):
d_c2scmd 10800 <ID> <Amount desired>

Spawn a single Item Into Bag (Use this code when you need to spawn a Pet Egg):
d_c2scmd 10807 <ID>

Spawn a monster:
d_c2scmd 10802 <MonsterID> <Num> 0 0

Expand bag:
d_c2scmd 2016 96


See Server Date/Time
d_getservertime

Change Z axis
d_c2scmd 2012 740404 xxxx

Fly
d_c2scmd 10803 66

Level Pet
d_c2scmd 5003

Talent Reset Item
d_c2scmd 10807 13227

Job EXP
d_c2scmd 1999 XX - Where XX = a number 1-34 
(32=Socialite, 33=Adventurer, 34=Merchant)

Reputation Points
d_c2scmd 10807 4494

Job Points
d_c2scmd 10807 4495

Advance Server Era:
d_delcmd 1988 5000000

Guild Bid
Start: d_delcmd 2010 1
Finish: d_delcmd 2011 1

Guild Base Funds: d_c2scmd 9001 Amount     e.g. d_c2scmd 9001 100000
d_c2scmd 9001 -100000

Guild Zeal: d_c2scmd 9002 Amount

Guild Base Resource Value: d_c2scmd 9002 Type# Amount     (Type# 1~4)
e.g. d_c2scmd 9002 2 50000

Guild Construction Quest Amount: d_c2scmd 9003 Amount

Individual Contribution and Guild Contribution: d_c2scmd 9004 Amount 

Economy = d_c2scmd 9000 1 50000

Magic = d_c2scmd 9000 2 50000

Amor = d_c2scmd 9000 3 50000

Civilization = d_c2scmd 9000 4 50000

Faith: = d_c2scmd 9000 5 50000

The Command for completing construction: d_c2scmd 9003 200

Leaf of World Tree
d_c2scmd 2014

Gshop Edting

Ok this will be a work in progress as I am learning it myself to teach it to you guys but lets get started. You will need these for sure.



in case you need it.

Note in order to use it in the data you must click import 1.4.4.Then to save it once its done you click export 1.4.4.

Make sure you back up or rename your original gshop files before doing this. Now me and my server partner emungx3. Went over this a hundred times and figured out the traditional methods seem to create pitfalls. Also the gshop in this release seems to be corrupted as another user said. Best to start with a empty gshop or one you know works. Now for the fun part.

1. Open your gshop add all the items, and make sure they all have a price. For testing you can use the option to change all prices to 1 silver. Then switch them all to client control mode.

2. This gets its own spot because this is important props to emungx3 for figuring this out. Hit get new time stamp once you gave it click export 1.4.4 server and save your new gshop.data.

3. Don't close the editor yet make sure you have a copy of your gshopsev data from your server directory on your computer. Click export 1.4.4 server. Do not save a brand new file, I dont know why this works but it does. Navigate to the copy of your sev data you downloaded click it then tell it to overwrite when you save.

4. Now upload your new gshop and sev file to your server. Also replace the gshop data in elements/data in your client as it has to match the data on your server.

5. Restart your server, the new data will not take without doing this step.



Note your gshop files are in home/gamed/config on your server if your root is different just replace home with it.

in the client the gshop data can be found in element/data. Also be mindful you have to make sure you put the new file in the client and server side. Here a copy of some un-corrupted Remember you need to re time stamp it and fix your sev file.

Note this is still a wip but that will get the basic question of what do i edit with and how out of the way. Notice I need someone with more gshop experience to help me finish this part of the guide. This is as far as ive gotten for now please ask any questions you have though I will try to answer.


Hex Editing.

Ok this is a little guide on hex editing items using the character tab in pwAdmin note I haven't done direct xml editing yet. I don't have time till next weekend to delve into that but. Using this tool you can generate new hex data. What I have been doing is since it just edits the hex data of the item in your inventory. I will buy a cheap item and replace its hex valuee to re-stat it. I used this to make gm items for my gms and such. Not make sure the item you edit is the same kind as the hex you generate. Axe for an axe plate for a plate etc. Notice you cant go outside the values the games lay down. If you try more than 2 socket stones on a weapon or more than 4 on armor it will either delete it or it wont show up in your inventory. If that happens re edit one or more of the stats you added arent being accepted by the system. Incase im not clear buy a simple item so its in your inventory go to the character tab in pwAdmin select it then put the new hex in the hex value.. also a good thing to know set duration to 100 its your durability otherwise you wont be able to use the weapon.

A little example of what I did with this tool:

crucifix - Perfect World 1.5.1 Server Setup SIMPLIFIED - RaGEZONE Forums



The tool is
I will add a tutorial later on xml editng once I can mess around with it. Don't know who made this tool but NRG I think but a link to the user profile to add to the guide would be appreciated. Note it only does weapons and armor and ive seen an issue with bows where it wont let you equip arrows but you can fire it all the same.

This guide is also a wip but I wanted to go ahead and put the info out I had for you guys.

Setting up spatch

Ok now we are going to go over how to setup spatch to update your server. Spatch is available through Note there are a lot of other useful tools in there. Though for the purpose of this guide. I have custom edited a version of spatch which you can get .

Setting it up.

1. Download and extract the link I posted above which can be found

2 place the files found in the spatch folder in the root of your main drive. (usually C: ) otherwise the tools will not work. Make a folder in the same directory called ec_patch. Leave this alone now for a moment and continue to step 3.

3. On your server under your www. directory create a folder called patch make sure to chmod it to 755 atleast. Now navigate to it in your browser and make sure you can access it. Once you know you can upload a copy of the version.sw file to the patch folder you created. Chmod it to 755. Rename it to versions.sw.

4. In the ec_patch folder you created earlier make a folder called element, the inside of this folder should look just like the file structure of the client. element,launcher, patcher etc. Place any files you want to update in this folder just as they would be in the client.

5. Once you have the files arranged in the folder rename launcher.exe to patcher.exe(ONLY DO THIS FOR THE FILES ON YOUR C DRIVE) drag ec_patch over patcher.exe. you may be prompted to run as admin let it and it will create a .xup file. rename this file to ec_patch_0-1.xup and upload it to your patch directory on your server make sure to chmod your update file too just in case.

Now edit your version.sw file on your server to add the line 1=ec_patch_0-1.xup underneath the 0 and save it.

6. Now back in the client, copy the files for the spatch one more time. Note you can run it from the patcher folder too but in this tutorial I am saying to add it to the launcher folder that way each time your users launch they will see if there is a new update or not without having to go into another folder and run the update. Copy the spatch folders from my file into the launcher folder. Let it over ride the old Launcher.exe. ( if your using the stock version from svn delete Launcher.exe and rename the patcher,exe file to Launcher. ) Do not edit the version.sw file in the client leave it alone.

7. Now edit patcher.ini to point to your update directory if you followed the guide its YOUR DOMAIN or IP/patch. Optionally you can comment out the note line too. Once this is done save it and run the new Launcher.exe. It should find your update and if you click update it should download it. Note for test purposes I would only update one file in your first update.

3.1. what console? where i can find it?
 
Initiate Mage
Joined
Sep 5, 2015
Messages
3
Reaction score
0
first of all i wanna thank you for this release, all works great but the GShop is not working, i tried to oppened it with the gshop editor's that i found on forum but no one works :s neither server side neither client side , could someone send me a working one ?
 

Ben

Developer - JS
Developer
Joined
Jul 6, 2013
Messages
1,224
Reaction score
506
first of all i wanna thank you for this release, all works great but the GShop is not working, i tried to oppened it with the gshop editor's that i found on forum but no one works :s neither server side neither client side , could someone send me a working one ?

Throwing any error?
 
Back
Top