Author Topic: About modification core game  (Read 6514 times)

Zelgadiss

  • Guest
About modification core game
« on: November 20, 2008, 08:57:34 pm »
I have a question:

I want modificate any files for adapted game to my version of game.

For the moment i need uncoment any lines
For example: Lines for optimize DB. I do this for cron job. And other maintenace options.

¿If this posible? ¿Are any restriction?

Other things ^^

1 - There are 1 error with Ajax code. Only with words with acents and letter "ñ"

My languaje is spanish and i'm translating game to spanish (using defeult translate system of game, with help of module translate wizard) And when ajax update if user have or no new mails show error See  this:


Quote
This is a error
"Mensajer�a Hermes: 0 nuevo(s), 0 viejo(s)"

This is a correct format:
"Mensajería Hermes: 0 nuevo(s), 0 viejo(s)"

2 - Exist any problem if i use ".($session['user']['sex']?"text female":"text male")." In any lines of code, for adaptet text to spanish?

Thx for atention ^^

P.D: Gratz! for your version ^^
« Last Edit: November 20, 2008, 10:40:19 pm by Zelgadiss »

Nightborn

  • Administrator
  • Sr. Member
  • *****
  • Posts: 318
  • Karma: +20/-0
    • View Profile
    • Shinobilegends
Re: About modification core game
« Reply #1 on: November 21, 2008, 08:48:22 am »
Hi,

welcome here  ;D

Okay, I hope I got everything right:

1. Cronjob
Yes, of course it's set up to run the main maintenance stuff (and newdays) from the cronjob.
If you want (for any reason) to separate this from the main cronjob that should run on every newday (remember: having a cronjob to do this is optional) you can comment the lines you don't like out in lib/newday/newday-runonce.php ... no big deal.
Just be certain to leave the new days in =) else you won't have any.

2. Language Problems with Ajax
Hm. I tested it on my game - and it worked (UTF-8).
 What charset do you use?
It should be any different from the usual game stuff.
You translated it - no core edit, right?

3. Translating
($session['user']['sex']?"text female":"text male") is not translation ready.
translate_inline($session['user']['sex']?"text female":"text male") is.
However, you can't get all options if you hit that site - also the wizard won't recognize it when it scans the file.
You could do: $male=translate_inline("lad"); $female=translate_inline("lass"); $text=($session['user']['sex']?$female:$male)
On a side note, ($session['user']['sex']==SEX_FEMALE?"text female":"text male") is better - if (for some reason) somebody invents a third gender for their game, it would break. =)
If you find an untranslated thing in the CORE, tell me and I'll fix it.

EDIT:
Some stuff has been fixed in 1.2.1 ... I might do an early release to distribute these changes. Namely the datacaching now works and so forth - also the settings provide an extended section to efficiently alter the mail texts that are sent to users.
It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro

Zelgadiss

  • Guest
Re: About modification core game
« Reply #2 on: November 21, 2008, 01:54:42 pm »
Hi^^

1 - Cronjob

Reason is easy, I want that game generate a new day, but not want that always that generate a new check for BD old coments, acc, etc, for user that generate this new day is slow. I prefer that for example: all weeks check for old coments, all days for olds accs, all weeks optimize DB……I want know that this are 100% do it. And not depend if any player enter in a game.

2- Language

I use charset for defect, i think ISO, if i use this i change for UTF-8 and this problem fixed ^^ (Need change all translation but no problem ^^)

3 - Transtalating

Thx for sugestion, i do this.

I'm using 1.2.1 version.


Other question.

I want change how give turns the game, for other method.
For do this need do other newday.php file (i think).

I want change stats of creatures and add more stats, (Race, element, elment lvl, size and type of hit) i want this because afect to (Atack, defense and hitpoints) i want do to players too.

Question is:

If I do new files, need share this files?

Ohhhh other thing

I get this error when i go to check game log, only when check categories.
Code: [Select]
SELECT count(logid) AS c FROM gamelog AND gamelog.category = 'maintenance'
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND gamelog.category = 'maintenance'' at line 1
Call Stack:
1: db_query("SELECT count(logid) AS c ...") called from /var/www/vhosts/dragonverde.net/subdomains/grecia/httpdocs/gamelog.php on line 40

I check my PHP version and my MYSQL version and is correct:

PHP: 5.1.6-15.el5
MYSQL: 5.0.22-2.2.el5_1.1


And other general error, that i cant know for what appear (sorry for this :( )
Code: [Select]
PHP Warning: "curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set"
in /var/www/vhosts/dragonverde.net/subdomains/grecia/httpdocs/lib/pullurl.php at 14.

I check my php.ini and safe_mode are off, and open_basedir not are set

Not find nothing that can help me.


Thx for your atention, and sorry for this problems :(
« Last Edit: November 21, 2008, 01:59:01 pm by Zelgadiss »

Nightborn

  • Administrator
  • Sr. Member
  • *****
  • Posts: 318
  • Karma: +20/-0
    • View Profile
    • Shinobilegends
Re: About modification core game
« Reply #3 on: November 21, 2008, 07:08:32 pm »
1)

Okay. Edit /lib/newday/newday-runonce.php to your liking - comment out the optimizing stuff and setup a cronjob for it.
make a new file LIKE cron.php ... or copy it =)
make sure this file is not (.htaccess!) accessible from the outside
then put the code to execute from the newday-runonce in there - you may want more files
then setup the cron.
note: if you do a cron, it generally is player independent.

but you brought up a good point: optimizations should not be really done on a server wide newday where many people are on.
I'll do some separation in 1.2.1 mayhap to split this up (parameter or so)

2)

ok, I recommend UTF-8 in any case

3) ok.

Note: 1.2.1 can change ... I am still working on it.

Yes, if you edit or expand the core, you need to give them out on demand - that's why I do so from the start :)
also, all modules relying on those (do not work without them) need to be given out on demand (you can loophole that though)

The elemental stuff etc is on my plan too - damage has a type, therefore there is resistance to it - and more
I will implement a "saving  throw" system to check against attributes, too.

@gamelog
the query is borked - what did you exactly press?

@general error

go to lib/pullurl.php
and change line 80 to this:

Code: [Select]
//if (function_exists("curl_init")) return _curl($url);

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro

Zelgadiss

  • Guest
Re: About modification core game
« Reply #4 on: November 22, 2008, 02:36:14 pm »
1) All cron activate in 5:00 am and diferent day

2)Now i'm usen UTF-8 and all are ok.

3) I'm using 1.2.1 version. When you relased final version, i do this

So you are in your plans elemental stuff…… we thinking the same??? this is worrying xDDDD

4)Gamelog, only check for category "View by char expiration" for example. Specific category.

5)General error, fixed ^^


I have a sugestion:

With your version, characters can do more than 15 lvls, but only are creatures to lvl 19. Is posible, that creatures have a unique lvl, and them game generated creature with appropriate lvl to player?? With this, you get:
1- Not create and modificate a lot of creatures with a lot of lvls
2- Is more easy for administrate
3- No need create new creature lvls because game generate it.

Nightborn

  • Administrator
  • Sr. Member
  • *****
  • Posts: 318
  • Karma: +20/-0
    • View Profile
    • Shinobilegends
Re: About modification core game
« Reply #5 on: November 22, 2008, 05:46:41 pm »
3) no, it's not. it's relatively normal to most games that damage types are differnet ;)

4) nice catch, replace line 39 in your gamelog.php with that one:
$sql = "SELECT count(logid) AS c FROM ".db_prefix("gamelog")." WHERE 1 $sqlcat";

5) yes

@creatures
well - I am not fond of automatically created creatures - it's pretty easy to insert new ones. =)
You have to do some work there - I can't insert random ones =) for experienced admins it's fairly easy.

2 - no, it's not ... if you want to be some stronger than others, or have special attacks (AI scripts) you still have to edit them.
also, you only do a large amount of creatures when you set your game up =) that's it.

3 - lame - I don't name your creatures for you, you have to touch them anyway.

large scale creature generation could and should be done in a module ... it's not a core necessity (too many themed games...)

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro

Nightborn

  • Administrator
  • Sr. Member
  • *****
  • Posts: 318
  • Karma: +20/-0
    • View Profile
    • Shinobilegends
Re: About modification core game
« Reply #6 on: November 30, 2008, 09:52:05 pm »
@cron setup

 11 *cron.php, lib/newday/newday_runonce.php and more in there --> you can now f    ully configure what you want to do with the cron: newday (hooks), char expir    ation, comment expiration, db optimization... selectable via a bitmask (see     cron.php at the top) what to do. I recommend (on large servers) to make the     a cron (commandline) with argument 1 (do only the newday) at your server new    day times. THEN do a cron.php 14 at a relatively calm time of the day - ther    e will be your db and comment cleanup stuff. This will make newdays swift an    d expirations (which take time and are high load) take place when you have e    nough ressources free.


this has been done in 1.2.1 now, but I am still testing it.
It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro