stfc2 / UI

User Interface
http://www.stfc.it
4 stars 5 forks source link

Question: Install of stfc2 #9

Open Caberhagen opened 9 years ago

Caberhagen commented 9 years ago

Hi

i tried to install your branch. I have setup the ui in webfolder and databes in mysql. Now i can't find the config.inc.php. So it shows me no connection to databes. Ande a can not see, waht for crons are needet. Du you have a setup how to? Or you can help me?

And thx for you work. was a long time ago i have played this game :)

kirirur commented 9 years ago

Hello, I'll try to help.

First of all I've added to the repository a sample of config.inc.php (it was missing since a lot). You'll need to fill it with your configuration.

Please take note that present version of the repository still assume the game running with two galaxies and a IPB forum, so if it's not your case you have to modify at least login.php, register.php, stats.php in pages folder and portal.php in modules folder.

I don't understand your trouble with the crons. If you mean the scheduler, they are all stored in a separate repository here on GitHub. There are mainly the following running tasks:

Depending on your configuration of the Galaxy (especially if you want NPC or not), it's possible to disable or customize the last two and main one.

Let me know if everything is clear now.

I hope you had and maybe you'll have great time on stfc! :)

Caberhagen commented 9 years ago

Thx this helps a lot.

$config=array(); $config['server']="localhost"; $config['port']="3306"; $config['user']="***"; $config['password']="****_"; $config['game_database']="_****"; $config['game_url']="http://game.sbhost.ch/game/"; $config['site_url']="http://game.sbhost.ch"; $config['game_path']="/var/www/virtual/game.sbhost.ch/htdocs/game/"; $config['scheduler_path']="/var/www/virtual/game.sbhost.ch/htdocs/scheduler/"; $config['galaxy']=0; $config['uploaddir'] = '/var/www/virtual/game.sbhost.ch/htdocs/gallery/';

define ('ERROR_LOG_FILE', '/var/www/virtual/game.sbhost.ch/htdocs/error_log.htm'); define ('ADMIN_LOG_FILE', '/var/www/virtual/game.sbhost.ch/htdocs/admin_log.htm'); define('DEFAULT_GFX_PATH', '/var/www/virtual/game.sbhost.ch/htdocs/gfx/'); define('PROXY_GFX_PATH', '/var/www/virtual/game.sbhost.ch/htdocs/gfx/'); define('JSCRIPT_PATH', '/var/www/virtual/game.sbhost.ch/htdocs/game/stgc2.js');

this is my setting on the dev box now. I am not sure about the js path.? is it the right?

Now the Start page open. but i have problems with queries from db. output from error_log

18.11.14 20:13:15 User: external user Database Error: Could not select database

No error occured (0)

But the values are rigth in config.inc.

i use mysql 5.5.40-0+wheezy1 PHP extension: mysqli

can mysqli be the problem?

and really thx for your help. :)

kirirur commented 9 years ago

It's seems quite good to me, only the define JSCRIPT_PATH needs to point to the folder containing the js and not directly the file. On mine config it's configured as '' and it works.

Current version of the game code is still using the old mysql php extension so yes, mysqli could be a problem if you have only this extension enabled. Luckly I've pull a request https://github.com/stfc2/UI/pull/6 in order to provide support to that extension,

Before applying the patch to your code, however, which page of the game show that error? I mean, you're able to log in?

Caberhagen commented 9 years ago

Error shows at login, register and statistics.

kirirur commented 9 years ago

Hmm, did you correctly modify UI/game/include/global.php in order to point correctly to your config.inc.php file?

Caberhagen commented 9 years ago

i think so: /var/www/virtual/game.sbhost.ch/htdocs/config.inc.php

so i try now your new merged version to see is mysqli the problem.

but anyway really thx for your help.

kirirur commented 9 years ago

Ok, it's seems a valid path indeed. Check the new mySQLi support, however I'm almost sure that the game can run on mySQL 5.5 without it with some failing queries, the problem you're facing seem something more serious. It seems the game cannot access to the whole database.

Just to be clear I'll repeat myself: are you sure you removed all references to secondary galaxy from the pages you mentioned? As I wrote in the first post?

Caberhagen commented 9 years ago

Ok startet now a new devbox. install all like you write here.

Now it look so as it connect to database. on login register and stats all fine.

crons not startet now. have tried to register first user. but on click the register button only refreshing page. and no new user in db.

if you want see the code on server, i can give you access by teamviewer. but i search to find the problem.

every day it looks a little bit better :)

Caberhagen commented 9 years ago

it seems like i have to start the galaxy first. but dont find where.

kirirur commented 9 years ago

Hello,

are you saying that after you've filled all required fields in registration form, when you it Register button nothing happened? This sound really strange to me. No errors came out?

It could be some skin related problem. After Register button is pressed the game performs some checks before creating the user (it should inform the user if something went wrong however), and if everything is fine it create the new user in the DB, the required instructions are just two:

if you downloaded the empty database from the repository you need to create at least one row in the skin table and add you own skin.

kirirur commented 9 years ago

It's difficult to have the game up and running, I know. That's why I'm trying to rationalize its code, restructure it in order to have a base in the future for a setup script. At the moment lot of the operations needed must be performed manually.

I think your problem at the moment is the empty DB, take a look to game/modules/tools/world/reset.php (unfortunately it can be called only logged to the game), you should find the needed mySQL query to create admin user.

I had forgotten that the default skin can be found here: https://github.com/stfc2/UI/blob/master/game/modules/tools/world/default_template.html

Caberhagen commented 9 years ago

Yes its the empty db. So it need in the sql data not only the structure also the values from reset. But with standard values like user:admin pw:admin email:muster@somthing.com So an intial setup will have the bas asmin account to start. Can you add the vaules to the database branch? Am 19.11.2014 20:34 schrieb "Andrea Carolfi" notifications@github.com:

It's difficult to have the game up and running, I know. That's why I'm trying to rationalize its code, restructure it in order to have a base in the future for a setup script. At the moment lot of the operations needed must be performed manually.

I think your problem at the moment is the empty DB, take a look to game/modules/tools/world/reset.php (unfortunately it can be called only logged to the game), you should find the needed mySQL query to create admin user.

I haven't yet loaded the skins in the repository, I'll do asap but I think you'll have one haven't it?

— Reply to this email directly or view it on GitHub https://github.com/stfc2/UI/issues/9#issuecomment-63699025.

kirirur commented 9 years ago

Well, I'm really sorry but my intention is to store on the repository only the structure of the DB, while the install script will do all the needed task and insert all the needed data. There are several steps to perform in order to start the galaxy, almost of them are already automated even if sparse in several scripts, my intention is to create a sort of "caller" of those scrips including a new one asking the installer for admin user authentication.

For your purpose you just have to take the data from the script reset.php and alter the password with phpMyAdmin to set your taste.

UI repository is not complete, when the work will be finished you'll have to download the latest release and launch the web installer.

Caberhagen commented 9 years ago

Ok i try it after work to add the values from reset.php. I added yesterday the first values to admin account. An can login to it. But have to add the rest to build the gakaxy. Am 20.11.2014 06:31 schrieb "Andrea Carolfi" notifications@github.com:

Well, I'm really sorry but my intention is to store on the repository only the structure of the DB, while the install script will do all the needed task and insert all the needed data. There are several steps to perform in order to start the galaxy, almost of them are already automated even if sparse in several scripts, my intention is to create a sort of "caller" of those scrips including a new one asking the installer for admin user authentication.

For your purpose you just have to take the data from the script reset.php and alter the password with phpMyAdmin to set your taste.

UI repository is not complete, when the work will be finished you'll have to download the latest release and launch the web installer.

— Reply to this email directly or view it on GitHub https://github.com/stfc2/UI/issues/9#issuecomment-63763290.

kirirur commented 9 years ago

That's good, you were able to login at last!.

You're near the end to the job, setup the skin, use the admin tools inside the game to create the star systems slots, install the BOT if you wish and create some planets. Here you have several choices:

Caberhagen commented 9 years ago

Oh god...

can you make me a dump from your db? so i can load it to my db and then make a galaxy reset. because i have added the stuff to db and it seems i have a fault everywere. Now on login i have a blank white page.

kirirur commented 9 years ago

Yes, it's normal. I'll explain why: the version of the code stored on the repository until yesterday, assumed the game is running side by side with a IPB forum. In the portal, as I wrote in the first post, the last five topic on the forum are displayed. With that version, when you try to open the portal (the first page of the game), if the forum isn't detected a blank page is displayed (that's an error of course, a message should be more appropriate). This afternoon I've fixed this. I've changed config.inc.php and portal.php in order to display forum info only if available. To turn off this feature you have to set $config['forum_show'] variable to 0.

I've made myself on my computer a test and it worked: you need this SQL queries (if you haven't already performed on your DB) in order to login to the game:

kirirur commented 9 years ago

I know it can seems quite boring but once you get used to it, you'll find yourself seting up the game in a matter of snap. :)

And in the future there will be the installer.

PS: Remeber to update your source code, I've made some fixes just today.

Caberhagen commented 9 years ago

yeah i can now log in. but the skin not showing. in db, user_templates/user_templates what is needet? the path to skin or?

have a wihte page with based on stgc.de and query time. also a mistery code: Bilder-Upload.eu - share DEINE Bilder

kirirur commented 9 years ago

Create the template: INSERT INTO user_templates (user_id, user_template) VALUES (10, " < the template skin here > '")

Replace < the template skin here > with the whole content of this file:

https://github.com/stfc2/UI/blob/master/game/modules/tools/world/default_template.html

Caberhagen commented 9 years ago

Now it looking good. Can now login. Fixet some false pathe with gfx and all shows. But the tick wil not run. Makes refresh on every click on the page. I have set the pathfs in config script from sheduler. But where is the daemon folder to found?

kirirur commented 9 years ago

Hello,

have you downloaded the source code from Scheduler repository? Once done, suite a proper place on your server and configure config.script.php according to your data.

After everything is setup properly you need to add a cronjob for each deamon you want to run. The minimum to see the tick is a */3 minutes job running main.php daemon.

Then you can add the other tasks.

Rememeber that ships fights need the combat daemon available from Combat repository.

Caberhagen commented 9 years ago

Hi

yes i loadet it. placed it to my root home folder. config like:

<?php

// This should point directly to the directory game. $game_path = '/var/www/virtual/stgc.mining-pools.ch/htdocs/game/';

// This should point to the directory where the daemons game are installed. $script_path = '/var/www/virtual/stgc.mining-pools.ch/htdocs/combat/';

// This should point to the external url of the game. $game_url = 'http://stgc.mining-pools.ch';

?>

and cons:

so i think it have to run.?

kirirur commented 9 years ago

Yes, it should, maybe before piping to /dev/null, pipe to a log file to see if everything went fine.

Mine crons are:

I've made some little sh scripts to call php scripts.

Caberhagen commented 9 years ago

Hi

good day, the finish i can see :)

tick and crons running now. the most looks good. only one thing i see:

generetade pics from galaxy and quadrant not showing.

a hint for me?

kirirur commented 9 years ago

Al the galaxy images must ne created. Log in the game as admin and go to admin panel - world - recreate static maps. Remember that the folder shall be writeable by Apache as several others folder too.

I'm glad you're almost done, setting up stfc is a tough task. :)

Caberhagen commented 9 years ago

yeah all pics now show.

so now i can't see problems in admin account. registered first user account:

user on login becomes the wihte page. because the default template not set in user_templates on user creation. how i can make dem to set as default on user creation?

the user can not start build houses. they are red, but i don't see why?

kirirur commented 9 years ago

Hello,

did you insert a new line in skins table containing the default template?

When a new user is created, it copies from the default template (stored in skins) to user_template table, letting the user alter their skins without compromising other users.

If a newly created user cannot build anything, it's normal because there are no resources available on the newborn planet. Let some ticks to run, the first raw materials should start to be collected in the silos.

Caberhagen commented 9 years ago

Yes this was the problem. abter set the skin in skins table it works on new user creation.

but the problem with no buildin is still there.

It have resources and all to build. look pic:

Bilder-Upload.eu - share DEINE Bilder

Caberhagen commented 9 years ago

have i everywhre to set galaxy is started? so user can register but not start with building until the start date is reached?

Caberhagen commented 9 years ago

i found the problem. the planet of the usere have no value in plane_available_points. after change them to 1173 the user can start build. what i need to change that this value set automatic on user creation?

kirirur commented 9 years ago

Congratulation! You've just found a bug in game/include/libs/world.php when USER_START_BOOST = 0. :)

The available structure points are not initialized so they remain at its default value that is set to 0.

I'll open a new issue in order to track this bug.

Thank you.

Stay tuned for bug fixing.

Caberhagen commented 9 years ago

No problem. hope i found more, so i can help you a bit.

question, the last pics thats not showing are the user galaxy cart after click in ranking on a username. witch folder they are generatet? can be the problem of not setup the folder or no write acces to it.

Caberhagen commented 9 years ago

i found it. game/maps/tmp not createt. :)

kirirur commented 9 years ago

Hello!

I've just found an important row you need to add to your DB: a row in the config table. If you wants the BOTs it's also important it's created BEFORE installing them because installation routine stores some values there.

Usually initial values will be:

UPDATE config SET tick_id = 1, tick_time = UNIX_TIMESTAMP(), stardate = 21000.0, ferengitax_1 = 0, ferengitax_2 = 0, ferengitax_3 = 0, last_paytime = 0, future_ship = 0, settler_tmp_1 = 0, settler_tmp_2 = 0, settler_tmp_3 = 0, settler_tmp_4 = 0

Caberhagen commented 9 years ago

I have put them in allready. This was the problem the tick don't start. Am 22.11.2014 13:53 schrieb "Andrea Carolfi" notifications@github.com:

Hello!

I've just found an important row you need to add to your DB: a row in the config table. If you wants the BOTs it's also important it's created BEFORE installing them because installation routine stores some values there.

Usually initial values will be:

UPDATE config SET tick_id = 1, tick_time = '.time().', stardate = 21000.0, ferengitax_1 = 0, ferengitax_2 = 0, ferengitax_3 = 0, last_paytime = 0, future_ship = 0, settler_tmp_1 = 0, settler_tmp_2 = 0, settler_tmp_3 = 0, settler_tmp_4 = 0

— Reply to this email directly or view it on GitHub https://github.com/stfc2/UI/issues/9#issuecomment-64079333.

kirirur commented 9 years ago

You know? It's really useful this thread! We are founding more or less what the installer will have to do in order to have the game running. :)

Caberhagen commented 9 years ago

thats nice. good it help you to.

a question, where can i change the the build places from 2 to 4.

kirirur commented 9 years ago

Almost each configuration aspect of the game are stored in file global.php.

Caberhagen commented 9 years ago

hmm i have searched there, but i look again...

Caberhagen commented 9 years ago

yep found it :)

Caberhagen commented 9 years ago

so now i have to build until i have ships. then i can test combat. so we can found the rest for youre script. :)

Caberhagen commented 9 years ago

Hi

i see in config.inc script path from combat not available. wee don't need it?

kirirur commented 9 years ago

Hi, I don't know why but the path of the combat daemon is in the file moves_common.php.

Caberhagen commented 9 years ago

Soory just a nother fault by me.

script-path is set in config.script.php and moves_common have config includet. but i have the paht in common now set same as in config.script.

Thx anyway

kirirur commented 9 years ago

Don't worry isn't you, it's the game structure that's quite complex and twisted. There are more or less two configuration files:

Those are the main two handling installation issues,

There are then other two files (one I think it's mistake):

Caberhagen commented 9 years ago

Hi

i found a problem with notepad. the inserted text are not saved.

i found an output:

PHP Warning: mysql_real_escape_string(): Access denied for user 'www-data'@'localhost' (using password: NO) in /var/www/game/submit_notepad.php

so the game try to use not the game db from config inc. and with apache user without password.

how to chang it to game db?

Caberhagen commented 9 years ago

Hi I dont find the solution for notepad. But searching... Found a problem on shoutbox and messages. If the text have ä, ö and ü inside. The text are not showing.

kirirur commented 9 years ago

Hi,

could you please open different issues for the problem found in order to have more clarity?

Thank you!

We should stay with installation issues in this thread.

Caberhagen commented 9 years ago

After a lot of things are working, i started to test HZ. All pics and all links are working. but can take any action. In DB at config the bot have som money. but if i want make a soldier sell. It say me the bot have not enugh money or i have no soldiers. But all is here. In NPC tick log i can't see a problem.