PDA

View Full Version : Howto setup a Linux Eqemu server


Muuss
12-15-2004, 09:54 AM
Advanced EqEmu Linux Setup

This guide has for goal to show how to install a working eqemu server on a Linux box. It's written for Linux but will prolly also work with FreeBSD and Linux clones. It requires a basic Linux knowledge, I certainly won't go deeper enough to teach you how to install Linux, or login on your system. This is widely covered on the web, Google is your best friend.
I won't also cover all the details of the server configuration (ini files), since they are exactly the same with Linux or Windows.
Please refer to the following guides if you need to :
HOWTO: Host a 6.0-DR2 Server! + Minilogin! (WIN32) : http://www.eqemulator.net/forums/viewtopic.php?t=18935
HOWTO: Host a 6.0 Server on Windows (Perl Quests enabled!!) : http://www.eqemulator.net/forums/viewtopic.php?t=17531

Please keep in mind that you can setup a Linux box as Eqemu server only if you're on your own LAN (private network). Usually, LAN addresses are taken into the 192.168.*.* range, but if you are on an company network (don't let your boss know that you play EQ at work !), it can be something else.

Prerequisites

- A working Linux box, with a working LAN connexion
- Around 1.5 Gbytes of freespace.
- An EqEmu source package, get it from Sourceforge (links on http://eqemulator.net), or from anywhere else, it doesn't matter much.
- Eqemu maps, needed for pathing and line of sight code, get them from sourceforge, or http://www.rogean.com/maps/maps.zip
- A ton of patience and concentration.
- Minilogin.exe (also from Sourceforge) if you want to run a private server.
- Perl 5.8.0+ (this is installed on most recent Linux distribs)
Optional
- A working install of Samba (Windows server emulator, I won't also cover it here since there's several billions tutorial about Samba on the web).
- Knowing how to use a linux text editor, vi for example.
- A 6.0+ database. PEQ lastest release for example, and all the database updates from http://www.eqemulator.net/databases_v6.php.


Part 0 : What are we going to install ?

We're about to install, starting from nothing, an EqEmu server, on a Linux box. This means that, once done, you'll have your own EqEmu server. If you only want to play to Everquest on an EqEmu server, you don't need to do all this, just go back to the Tutorial forum and open an "How to play" topic. This is only for people who want to run their own server, private or public.

For that guide, we will decide that we want to create a PEQ Minilogin server. Mysql is running on the linux box (it could be ran on another box, Linux or Windows, doesn't matter much). We will connect to it with an account named eqemu and eqpassword as password and the EQ database's name will be eqemu . The server's IP address is 192.168.0.100


Part 1 : Preparing the battlefield

Before unpacking your source or doing any compilation, you must think about what you're going to do.
We will install a software that is frequently updated and requires lot's of tweaking. This parameters must be kept in mind when installing. You will have to change your server's version at least 1 or 2 times per month if you wanna stay uptodate, perhaps even more if your goal is to have a public server.

Which version of Linux ? Well, it's not important as long as it's 'modern' enough. A 2.4.18 or more recent is ok. Memory usage will depend of what you'll do of your server. For private use, 256 Mb and 512 Mb of swap are enough, for a public server, the more the better.

Hard disk space : EqEmu requires now lots of disk space for the map files. The software by itself occupies only a few Mb. I suggest you to choose a partition which has at least 3 or 4 free Gb, even if you don't need them all, there's nothing more boring than full partitions. Avoid the partition(s) that contain /, /tmp and /var. One of the best choices would be to have a dedicated partition for eqemu. For that guide, we will consider that we have mounted a 5+ Gb partition on /eqemu.

Directory structure : Login as root and create the following directories :
/eqemu/source : This is where you'll unpack your packages and compile them.
/eqemu/server : This is where you'll set your server.

mkdir /eqemu
mkdir /eqemu/source
mkdir /eqemu/server
chown -R root:root /eqemu
chmod -R 775 /eqemu


Part 2 : Compilation

Note concerning non-Intel or old CPUs: If the CPU or your Linux Box isn’t a Pentium 2 or higher and you encounter an error message of the kind [1]+ Illegal instruction ./world when running the binaries, you will have to edit the makefile and makefile.perl files to change the value of the –march option. If you have a Pentium 1, set it to i586. Other CPUs also have their own settings, but if you have one, you yet certainly know what to use ?

Compiling is the hardest part of the process and where you may encounter most of the problems.
Unpack the source archive into /eqemu/source. You will then obtain a new directory named Source. Rename that directory with the date of the day :

mv Source 12152004

Doing this, you'll keep your different source codes and will be able to go back to an old, and working, setup if something goes wrong with a new one in the future.

Mysql include files
Run the following command : mysql_config --cflags
It will return you something that looks like : -I'/usr/local/include'

This is where mysql_config thinks your mysql include files are. If you re-installed mysql and made some links to replace the old mysql binaries, it's perhaps not working and will lead you to a compile error.

List the files from the directory returned by mysql_config : ls /usr/local/include/mysql*h
If you obtain a list of files that contains mysql.h, mysql_com.h and some other mysql* files, you're good to go.
If not, you have 2 options :

- Pretty one : Edit the makefile (the file where compilation options are) of what you gonna compile, it means 3 makefile edition per EqEmu compilation.
- Uggly one : Copy or link the needed mysql include files into /usr/local/include (or any directory returned by mysql_config !)
- Advanced one : Edit your mysql_config script and fix the error.

For once, we gonna be uggly because it will be easier.

Find your mysql include files : locate mysql_com.h
This will return prolly several rows. Determinate the one that points where mysql have been installed. If you did it yourself, you certainly yet know where it was, if you didn't, its perhaps something like /usr/include/mysql/mysql_com.h

Now, run this :
ln -s /usr/include/mysql/mysql*.h /usr/local/include/

This will create symbolic links of mysql include files into the directory mysql_config thinks they should be.

Compilation : libEMuShareMem.so

Go to /eqemu/source/12152004/EMuShareMem, and run make

cd /eqemu/source/12152004/EMuShareMem
make clean ; make

If you respected the step with mysql include files, compilation will be easy.

Compilation : world

Go to /eqemu/source/12152004/world, and run make

cd /eqemu/source/12152004/world
make clean ; make

Compilation : zone

cd /eqemu/source/12152004/zone
make clean
make -f makefile.perl

If you don’t have mysql_config on your Linux box
Create it somewhere in your PATH, for example in /usr/bin :

vi /usr/bin/mysql_config

#!/bin/sh

cflags="-I/usr/local/share/mysql/include/mysql"
include="-I/usr/local/share/mysql/include/mysql"
libs="-L/usr/local/share/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm"
libs_r="-L/usr/local/share/mysql/lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm -lpthread"
socket="/tmp/mysql.sock"
port="3306"
version="4.0.18"
embedded_libs="-L/usr/local/share/mysql/lib/mysql -lmysqld -lpthread -lz -lcrypt -lnsl -lm -lpthread -lrt"

usage () {
cat <<EOF
Usage: $0 [OPTIONS]
Options:
--cflags [$cflags]
--include [$include]
--libs [$libs]
--libs_r [$libs_r]
--socket [$socket]
--port [$port]
--version [$version]
--libmysqld-libs [$embedded_libs]
EOF
exit 1
}

if test $# -le 0; then usage; fi

while test $# -gt 0; do
case $1 in
--cflags) echo "$cflags" ;;
--include) echo "$include" ;;
--libs) echo "$libs" ;;
--libs_r) echo "$libs_r" ;;
--socket) echo "$socket" ;;
--port) echo "$port" ;;
--version) echo "$version" ;;
--embedded-libs | --embedded | --libmysqld-libs) echo "$embedded_libs" ;;
*) usage ;;
esac

shift
done

exit 0


Edit the values of cflags, include and libs… with the right directories.
chmod +x /usr/bin/mysql_config

Part 3 : The database

Step 1 : creating a mysql account for eqemu
If your mysql server is on another box, please be smart enough to work on that box :)
Under Linux, you will access to your mysql server from your mysql client with the following command : mysql -p
Connect to mysql using mysql -p, if you didn't installed mysql yourself, there's probably no password specified as root password, just press enter when mysql will ask you for a password. Once connected, you ll obtain a mysql prompt that looks like 'mysql>'. Follow the next steps :

We will work on the database named mysql (the one that contains mysql accounts, privileges and such...)
mysql> use mysql;

Now we list the existing mysql accounts
mysql> select Host,User from user;

You mustn't use the root user for security reasons, instead, create or use another account. Create a new account if needed :
If your mysql server is on your Linux box :
mysql> insert into user set Host='localhost', User='eqemu', Password=password('eqpassword');

If your mysql server is on another box :
mysql> insert into user set Host='192.168.0.100', User='eqemu', Password=password('eqpassword');

Now create your eqemu database :
mysql> create database eqemu;

Give rights to access the eqemu database to the eqemu account :
mysql> grant all privileges on eqemu.* to 'eqemu'@'localhost';

or if mysql is on another box :
mysql> grant all privileges on eqemu.* to 'eqemu'@'192.168.0.100';

We refresh the global privileges so mysql knows that we added a new account :
mysql> flush privileges;

And we can quit mysql:
mysql> exit;

Note : If you’re using mysql 4.1 or higher and experiment some errors #1251 or #2006 when trying to connect to mysql with your eqemu account run the following query :

mysql> use mysql;
mysql> update user set Password=old_password('eqpassword') where Host='localhost and User='eqemu';
mysql> flush privileges;



Step 2 : connect to mysql using the eqemu account
Note : you could do that step using the root account, but if you do it with the eqemu account (and from the eqemu server box if mysql server is on another box), you ll be sure that your mysql config is operationnal !

Create a directory name database into your eqemu tree : mkdir /eqemu/database
(Do this even if your mysql box isnt your eqemu box)
Copy and unpack your db files into that directory. There should be the PEQ file, and several smaller update files. You will also need to find every recent update made to the database, in the forum and by reading the HISTORY file contained in the eqemu packages.

Now connect to mysql, mysql server is your eqemu box :
mysql -p -u eqemu eqemu

mysql is on another box (let's say it is 192.168.0.120)
mysql -p -u eqemu -h 192.168.0.120 eqemu

If you can connect to mysql and obtain the mysql prompt, bravo, your mysql setup is ok, if not, go back to step 1 and try find where things started to mess up. Eventually, ask for help on Eqemu forums.

Source all the database files using the 'source' command :
mysql> source PEQ_Kunark_RC1.sql;
mysql> source aa_levels.sql;
etc ...

Database structure is the same for Linux and Windows.

Tips : I suggest you to add -s as option when connecting to mysql. Doing so, mysql client won't show you what he sources into the database, and it ll be 15 or 20 time faster :) : mysql -p -u eqemu -s eqemu

Step 3 : For minilogin users
Log into mysql, like explained at step 2 and run the following queries :

mysql> INSERT INTO variables (varname, value, information) VALUES ('LoginType', 'Minilogin', 'Set this to Minilogin to login using a minilogin server :)');
mysql> alter table account add minilogin_ip varchar(32) not null;
mysql> insert into account (name,status, minilogin_ip) values('Muuss',250,'192.168.0.30');

Please refer to http://www.eqemulator.net/forums/viewtopic.php?t=17843 for this third step, let's not re-invent the wheel, Edgar wrote a tutorial, use it !

Part 4 : Perl (Quests)

Create a quests directory into /eqemu/server : mkdir /eqemu/server/quests

Download : http://search.cpan.org/CPAN/authors/id/E/ER/ERYQ/IO-stringy-2.109.tar.gz
and copy it somewhere onto your Linux box, then run the following commands :
tar zxvf IO-stringy-2.109.tar.gz
cd IO-stringy-2.109
perl Makefile.PL
make
make test (should tell you that everything is ok !)
make install

This is easier than the online install via CPAN.

Part 5 : Installing the server

Everything will now take place into /eqemu/server

Step 1 : the server binaries
We will now use the binaries generated during the Part 2. You can either copy them here, or link them. Choose to link them if you're working on a private server and think you ll play with eqemu source code, so, after each compile, your server will be operationnal. Copy them if you're running a public server and can't shut it down too often.

Links :
ln -s /eqemu/source/12152004/EMuShareMem/libEMuShareMem.so /eqemu/server/libEMuShareMem.so
ln -s /eqemu/source/12152004/world/world /eqemu/server/world
ln -s /eqemu/source/12152004/zone/zone /eqemu/server/zone

Step 2 : map files
Create a directory named maps where you'll unpack your map files.

mkdir /eqemu/server/maps

copy and unpack the map files into that directory.

Step 3 : db.ini
We need to create several files that will contain eqemu configurations into the server's directory. I suggest you to create the files from nothing, that's the best way to understand what you're doing.

cd /eqemu/server
vi db.ini

[Database]
host=localhost
user=eqemu
password=eqpassword
database=eqemu

or, if you're using a deported mysql server

[Database]
host=192.168.0.120
user=eqemu
password=eqpassword
database=eqemu

Step 4 : Login process
Two alternatives here, choose the one that suits you :
go to step 5 if you create a Minilogin server (private server)
go to step 6 if you create a public server (using eqemulator login servers)

Step 5 : Minilogin
If you plan to use the public login servers, go directly to step 7.
Start by reading this : http://www.eqemulator.net/forums/viewtopic.php?t=17843
Since we're running the server on a Linux box and Minilogin.exe is a Win32 software, we can't run it on the server box. Any Windows client on your Lan will do the job very well. Let's say that the computer you will play on is 192.168.0.30.
Edit LoginServer.ini

cd /eqemu/server
vi LoginServer.ini

[LoginServer]
loginserver=192.168.0.30
loginport=5999
worldname=My private world
worldaddress=192.168.0.100
locked=false
account=
password=

[WorldServer]
Defaultstatus=20
Unavailzone=

[ChatChannelServer]
worldshortname= PrivateWorld
chataddress=
chatport=

[LoginConfig]
ServerMode=MiniLogin
ServerPort=5999


Now, copy Minilogin.exe and LoginServer.ini on your Windows computer (192.168.0.30), and place them into a directory you'll remember, like c:\minilogin for example. Remember that you'll need to launch minilogin.exe each time you will start your eqemu server !

Step 6 : Public login servers
If you plan to use Minilogin as login server, go back to step 5.

Edit LoginServer.ini
vi LoginServer.ini

[LoginServer]
loginserver=newlogin1.eqemulator.net
loginport=5994
worldname=What a wonderfull world
worldaddress=EXTERNAL_IP_ADDRESS
locked=false
account=
password=

[WorldServer]
Defaultstatus=0
Unavailzone=

[ChatChannelServer]
worldshortname=
chataddress=
chatport=

As EXTERNAL_IP_ADDRESS, enter the address your known on internet.It's the IP address of your router. If you don't know it, a solution may be to visit http://www.whatismyip.com/ but it won't work if you're using a HTTP proxy server. Another solution can be to run a traceroute command on an external server : traceroute yahoo.com

Step 7 : A few tests
Launch Minilogin.exe on your Windows computer. It should display the following text :
LoginServer.ini read.
Server mode: Standalone
Login server listening on port:5999
(Don't try to do this if you don't use minilogin)

Go to your server directory : cd /eqemu/server
And type this : ./world | grep EMuShare
Break with Ctrl+C.

If it says something about libEMuShareMem not loaded : [Error] LoadEMuShareMemDLL::Load() failed to load library 'libEMuShareMem.so'. Error=0
Run this : echo "/eqemu/server" >> /etc/ld.so.conf ; ldconfig

Re-run ./world | grep EMuShare and it should now return : [Status] libEMuShareMem.so loaded
Break with Ctrl+C.

Step 8 : zone script
Create a short script named zone, and put it somewhere in your path, /usr/bin for example.
vi /usr/bin/zone

#!/bin/sh
(cd /eqemu/server: ./zone EXTERNAL_IP_ADDRESS $1 77$2 192.168.0.100 &)


Save it, then make it executable : chmod +x /usr/bin/zone
This script will allow you to launch some zones without having to remember the zone syntax, example : zone . 90
will release a dynamic zone on port 7990.
zone commons 91 will launch a static zone for West Commonlands on port 7991.

Step 9 : Finishing the install
Create a directory for the log files : mkdir /eqemu/server/logs
Copy the following files into /eqemu/server : spells_us.txt, commands.pl, plugin.pl



Part 6 : Running the server


This is the typical process needed to run the server (take into consideration that Minilogin if you use it must be running on your Windows box) :

cd /eqemu/server
./world &
zone . 91
zone . 92

You can eventually add this into your init scripts, I won't go deeper, it's different on each distribution. A common way is to add it at the end of the file named rc.local.
You can also create a startup script that could looks like this :

#!/bin/sh

case "$1" in
'start')
echo "Starting EqEmu..."
echo " - starting world"
/eqemu/server/world 2>&1 1> /dev/null &
sleep 3
/eqemu/server/zone EXTERNAL_IP_ADDRESS . 7791 192.168.0.100 2>&1 1> /dev/null &
/eqemu/server/zone EXTERNAL_IP_ADDRESS . 7792 192.168.0.100 2>&1 1> /dev/null &
echo " - starting zones"
echo "... done";
;;
'stop')
echo "Killing EqEmu...";
killall world zone 2>/dev/null
echo "... done"
;;
'restart')
$0 stop
sleep 1
$0 start
;;
*)
echo "usage $0 start|stop|restart"
;;
esac

(replace EXTERNAL_IP_ADDRESS by your IP address...)

Part 7 : A few tips

- How to browse a logfile : tail -f /eqemu/server/logs/eqemu_zone.log

- Refer to Fathernitwit security post if you wanna secure your server.

- Kill telnet daemon and only use sshd.

- If you have samba, share /eqemu/server and copy Minilogin.exe in it. Doing this, you won't need it on your Windows computer, it can be ran thru a share.

- After your server crashed or when you started it with an incorrect database setup, zone could eventually refuse to boot up and will block on Loading doors or another table of the database. This problem is certainly linked to the fact that there’s a remaining and unvalid memory segment allocated by libEMuShareMem.so that wasn’t freed when the server crashed. To remove it, you will have to use ipcs and ipcrm commands.

This is a running server :
ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 0 webicim 600 46084 10 dest
0x49038098 393217 root 600 21003715 2
0x46038098 425986 root 600 3871168 1
0x4c038098 458755 root 600 1322356 1
0x44038098 491524 root 600 504730 1


This is the same server, after i killed it (notice the nattch fields)
ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 0 webicim 600 46084 10 dest
0x49038098 393217 root 600 21003715 0
0x46038098 425986 root 600 3871168 0
0x4c038098 458755 root 600 1322356 0
0x44038098 491524 root 600 504730 0

If zone hangs up when you try to boot it again, remove all the rows where nattch is 0. The command is ipcrm with –m as parameter and shmid field as identificator :
ipcrm –m 393217
After you removed all the segments allocated by eqemu, it’ll boot up again normally.


Revisions
- Added the part concerning IPCs
- Added the archictecture specific note (suggested by residentninja)
- Added a fix for the mysql errors 1251 and 2006. (suggested by residentninja)
- Rewrote mysql_config so there’s no more compilation errors
- Completed mysql_config support for people who don’t have it (suggested by residentninja)
- Modified starting script so it doesn’t use /usr/bin/zone script but directly /eqemu/server/zone binary

Muuss
12-15-2004, 09:56 AM
Waiting for feedback before moving this to tutorials forum.
(self-moderation isn't fun :p)

residentninja
12-16-2004, 08:41 AM
I tried your tutorial last night and found it very helpful. A few things you may want to add in. I am running Debian 2.4.18 kernel:
I did not have mysql-config for some reason but I had all mysql packages install that I could see so I had to do:

find / -iname mysql*.h

At which time I did not have those files and I to find out that I needed to install libmysql-dev to get them. Might want to make a Note for future people to know what package to get if they do not have the files need.I think there have been a few other small things but i can't remember now.

The problem I am have though after the tutorial is when I run server i get this:

bashir:/home/eqemu/server# ./world &
[1] 8142
bashir:/home/eqemu/server# /usr/bin/zone . 91
[1]+ Illegal instruction ./world
bashir:/home/eqemu/server#

If a do:
ps aux | grep world
ps aux | grep zone

I find that neither are running. I also tried just running world and checking to see if it was running and I get this:

bashir:/home/eqemu/server# ./world &
[1] 8131
bashir:/home/eqemu/server# ps aux | grep zone
root 8141 0.0 0.1 1332 432 pts/0 S 15:09 0:00 grep zone
[1]+ Illegal instruction ./world


I have recompiled EMuShareMem, world, and zone just to make sure and still I get the same thing. I also get the same result using the init script in the tutorial. It says it starts both but then there is nothing running. Also zone is not creating log files and there is nothing about it in syslog or any other log i have found so far. world doesn't seem to be creating log files either (not sure if it normally does).

Also one last thing. I am unable to connect to the mysql server with EQAdmin. Not that important at this point but...

Not sure what to do from here. I've exhausted everything I can think of and am getting brain fried since I'm in no way an EQEmu expert.

Muuss
12-16-2004, 10:01 AM
I m busy ATM and can't answer you immediately, but i ll test it tomorrow at work on a debian. World not running might not be linked to compilation troubles or kernel issues. World will crash on certain database errors. Try running it without the &, from the /eqemu/server directory, ie :
cd /eqemu/server
./world

What shows on the console will certainly help ya to figure what's wrong... If you can't fix it by urself, please ask for support into the linux support forum please, we d'like to keep tutorial forums for ... tutorials :)

I ll revise the part concerning mysql-config, if you don't have it, you can still compile the Freebsd way, thank you for leading my attention to that point, i ll add it to the guide.

Muuss
12-16-2004, 10:11 PM
Residentninja, I had no issue compiling under debian, Woody with a 2.4.18-bf2 kernel. I think your problems are coming from your configuration. If you're still blocked, start a thread into the linux forum, post your ini files and such...

residentninja
12-20-2004, 11:31 AM
please save millions of lives by adding this to your tutorial to be done right after the GRANT statement for mysql:

SET PASSWORD FOR 'someuser'@'bashir.pgprog.net' = OLD_PASSWORD('somepasswd');

Because I was not doing this I was getting errors #1251 and #2006 no matter how I did my grant permissions. This seems to only effect people running MySQL 4.1 and up...It caused me rage for several days.

Also I was only able to get world working on my system by editing the makefile and changing the -march statement to my specific processor (i586 for me) and by setting the option -O3
Anything else would cause world to compile but not to run.

Hope this helps your tutorial and others who my be having these problems.

Muuss
12-20-2004, 08:05 PM
please save millions of lives by adding this to your tutorial to be done right after the GRANT statement for mysql:

SET PASSWORD FOR 'someuser'@'bashir.pgprog.net' = OLD_PASSWORD('somepasswd');

Because I was not doing this I was getting errors #1251 and #2006 no matter how I did my grant permissions. This seems to only effect people running MySQL 4.1 and up...It caused me rage for several days.


I checked and verified this, thank you for submitting it. My opinion becomes, each day, that eqemu should host mysql binaries to be sure that people will use the right ones :)


Also I was only able to get world working on my system by editing the makefile and changing the -march statement to my specific processor (i586 for me) and by setting the option -O3
Anything else would cause world to compile but not to run.


I ll put that remark about i686/i586 somewhere in the post too. Option -03 is only needed for optimization and doesn't differ much from -O2 (it affects inline functions).

Thank you for feedback.

Muuss
12-22-2004, 09:29 PM
Added support for IPCs.

aza77
03-01-2005, 09:09 AM
Step 2 : map files
Create a directory named maps where you'll unpack your map files.

Code:

mkdir /eqemu/server/maps



copy and unpack the map files into that directory.


found a little typo ...
it should be

mkdir /eqemu/server/Maps

great guide btw ;)

timex1
09-14-2005, 05:21 PM
Any ideas on this error?


[root@server EMuShareMem]# make
gcc -Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wno-deprecated -Wcomment -Wcast-align -DDEBUG=1 -DCATCH_CRASH -g -fPIC -O2 -D_GNU_SOURCE -DINVERSEXY -DFX `mysql_config --cflags` -c Doors.cpp -o Doors.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from ../zone/zonedump.h:31,
from Doors.h:2,
from Doors.cpp:12:
../zone/../common/Item.h:285: error: `sint16 Inventory::_PutItem(sint16, ItemInst*)' is protected
../zone/../common/Item.h:500: error: within this context
../zone/../common/Item.h:288: error: `sint16 Inventory::_HasItem(std::map<sint16, ItemInst*, std::less<sint16>, std::allocator<std::pair<const sint16, ItemInst*> > >&, const Item_Struct*, uint8)' is protected
../zone/../common/Item.h:573: error: within this context
../zone/../common/Item.h:290: error: `sint16 Inventory::_HasItemByUse(std::map<sint16, ItemInst*, std::less<sint16>, std::allocator<std::pair<const sint16, ItemInst*> > >&, uint8, uint8)' is protected
../zone/../common/Item.h:575: error: within this context
../zone/../common/Item.h:285: error: `sint16 Inventory::_PutItem(sint16, ItemInst*)' is protected
../zone/../common/Item.h:582: error: within this context
make: *** [Doors.o] Error 1

gottasummer
10-12-2005, 08:33 AM
Any ideas on this error?


[root@server EMuShareMem]# make
gcc -Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wno-deprecated -Wcomment -Wcast-align -DDEBUG=1 -DCATCH_CRASH -g -fPIC -O2 -D_GNU_SOURCE -DINVERSEXY -DFX `mysql_config --cflags` -c Doors.cpp -o Doors.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from ../zone/zonedump.h:31,
from Doors.h:2,
from Doors.cpp:12:
../zone/../common/Item.h:285: error: `sint16 Inventory::_PutItem(sint16, ItemInst*)' is protected
../zone/../common/Item.h:500: error: within this context
../zone/../common/Item.h:288: error: `sint16 Inventory::_HasItem(std::map<sint16, ItemInst*, std::less<sint16>, std::allocator<std::pair<const sint16, ItemInst*> > >&, const Item_Struct*, uint8)' is protected
../zone/../common/Item.h:573: error: within this context
../zone/../common/Item.h:290: error: `sint16 Inventory::_HasItemByUse(std::map<sint16, ItemInst*, std::less<sint16>, std::allocator<std::pair<const sint16, ItemInst*> > >&, uint8, uint8)' is protected
../zone/../common/Item.h:575: error: within this context
../zone/../common/Item.h:285: error: `sint16 Inventory::_PutItem(sint16, ItemInst*)' is protected
../zone/../common/Item.h:582: error: within this context
make: *** [Doors.o] Error 1

Same error! Help

johane
10-12-2005, 11:27 AM
Same error! Help

There's a few posts that describe how to fix this already, but here we go:

Find the class declaration where the errors are (common/Item.h around line 280)
Find the word

public:


Move that word down to just after the last method that the compiler complains about.

Note that it's worthwhile learning a bit about C++ - there are heaps of good books and web references that can teach you about C++ scoping and hiding.

Belfedia
10-13-2005, 06:13 AM
Hello all,

last linux guide is on the wiki : http://www.eqemulator.net/wiki/wikka.php?wakka=LinuxServer
and some usefull information :)
You can use, edit and correct this !!!

gottasummer
10-13-2005, 10:14 AM
yeah I figured that out.

I am a novice C++ programmer lol... self-taught... I dont know much but I figured that out.

Now Zones wont compile...