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!

Travian P-Alpha 2.03 (All bases support)

Status
Not open for further replies.
akakori
Joined
Apr 3, 2008
Messages
368
Reaction score
98
Re: Actual Working Project on Travian

Sparkly.. its not hard to get all the pics down in one shot.. i managed that =)

Anyone who find my source stupid can just dont use it.. > > this is just for the fun of killing my time anyway

Assignment of the base failed.. thats why u cant reg.. u need some data in the wdata.. defining the type of the field to be type 3... the support for the rest of the fields havent been coded yet.. since 3 is the main one.. so i am just working on it for now..
admin panel can come later when i fixed more stuff.. > >
 
Last edited:
Initiate Mage
Joined
Dec 28, 2008
Messages
5
Reaction score
0
Re: Actual Working Project on Travian

PHP:
Fatal error: Call to undefined method mysqli_result::fetch_all() in W:\www\Travianclone\s1\include\functions.php on line 59
how to fix it?
 
Last edited:
Junior Spellweaver
Joined
Feb 23, 2007
Messages
143
Reaction score
14
Re: Actual Working Project on Travian

Lets see if this project actually does what it says and doesn't die out like all the other ones.
 
Custom Title Activated
Member
Joined
Dec 21, 2007
Messages
1,040
Reaction score
127
Re: Actual Working Project on Travian

Even if akakori quits, I'll continue mine ;) Holidays are almost here, even more time for me to work on it.
 
ThuGie.NL - Webmaster
Joined
Apr 16, 2006
Messages
607
Reaction score
55
Re: Actual Working Project on Travian

hey you might wanna try learning about LIMIT 1 for your mysql it might speed up alot of things :).

Like your current,
Code:
	$q = "SELECT email FROM ".TB_PREFIX."USERS where email = '$email'";
Could be
Code:
	$q = "SELECT email FROM ".TB_PREFIX."USERS where email = '$email' LIMIT 1";

Now your current even when it found 1 result yes you only need one result to check for a existing email it will still check all the other users,
Now with limit 1 added it will stop right when it found the email,

Now think like this your the first registerd user and you got 10k members,
And use your current function to see if the email exists it will look tru all 10k members even though it found it at the first row.

See how more faster it will be ?
 
akakori
Joined
Apr 3, 2008
Messages
368
Reaction score
98
Re: Actual Working Project on Travian

thanks.. added > <

side note...

I fixed dorf2.php with the build... =)

Exported the data into arrays once again... figured it would be friendlier towards the sql server.. since i am calling almost everything from it every now and den...

I doubt i would quit this project.. i really doubt so.. all there's left is the easy part.. ranking,message system and the map... putting the different types of fields into account.. adding mutli village, troops, finalize the installation script.. and i am done.. aint i?
 
Last edited:
Initiate Mage
Joined
Jun 28, 2005
Messages
20
Reaction score
0
Re: Actual Working Project on Travian

mm... i cant login into game... dont say error only refresh page ;P
 
Initiate Mage
Joined
Dec 7, 2009
Messages
13
Reaction score
0
Re: Actual Working Project on Travian

Hello, I`am too can`t login, how to fix it ?:)It will be great ;)
 
akakori
Joined
Apr 3, 2008
Messages
368
Reaction score
98
Re: Actual Working Project on Travian

cant login? O o

Thats probably because u werent assigned a base.. =)

Try

INSERT into s1.wdata values (0,3,0,0,0);

that will place a type 3 base on x= 0, y =0 and set it to be not occupied
after which register again.. u shld be able to login.. =)

Here's an exact sql with empty database and some empty base.
Code:
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 07, 2009 at 09:54 PM
-- Server version: 5.1.36
-- PHP Version: 5.3.0

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `s1`
--

-- --------------------------------------------------------

--
-- Table structure for table `s1_active`
--

CREATE TABLE IF NOT EXISTS `s1_active` (
  `username` varchar(15) NOT NULL,
  `timestamp` int(11) unsigned NOT NULL,
  PRIMARY KEY (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `s1_active`
--


-- --------------------------------------------------------

--
-- Table structure for table `s1_baselog`
--

CREATE TABLE IF NOT EXISTS `s1_baselog` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `vid` int(10) unsigned NOT NULL,
  `comment` text NOT NULL,
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `s1_baselog`
--


-- --------------------------------------------------------

--
-- Table structure for table `s1_fdata`
--

CREATE TABLE IF NOT EXISTS `s1_fdata` (
  `vref` int(10) unsigned NOT NULL,
  `f1` tinyint(2) unsigned NOT NULL,
  `f2` tinyint(2) unsigned NOT NULL,
  `f3` tinyint(2) unsigned NOT NULL,
  `f4` tinyint(2) unsigned NOT NULL,
  `f5` tinyint(2) unsigned NOT NULL,
  `f6` tinyint(2) unsigned NOT NULL,
  `f7` tinyint(2) unsigned NOT NULL,
  `f8` tinyint(2) unsigned NOT NULL,
  `f9` tinyint(2) unsigned NOT NULL,
  `f10` tinyint(2) unsigned NOT NULL,
  `f11` tinyint(2) unsigned NOT NULL,
  `f12` tinyint(2) unsigned NOT NULL,
  `f13` tinyint(2) unsigned NOT NULL,
  `f14` tinyint(2) unsigned NOT NULL,
  `f15` tinyint(2) unsigned NOT NULL,
  `f16` tinyint(2) unsigned NOT NULL,
  `f17` tinyint(2) unsigned NOT NULL,
  `f18` tinyint(2) unsigned NOT NULL,
  `starttime` int(11) unsigned NOT NULL,
  `endtime` int(11) unsigned NOT NULL,
  `upgrading` tinyint(2) unsigned NOT NULL,
  PRIMARY KEY (`vref`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;

--
-- Dumping data for table `s1_fdata`
--


-- --------------------------------------------------------

--
-- Table structure for table `s1_users`
--

CREATE TABLE IF NOT EXISTS `s1_users` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(15) NOT NULL,
  `password` varchar(32) NOT NULL,
  `access` tinyint(1) unsigned NOT NULL,
  `email` varchar(50) NOT NULL,
  `timestamp` int(11) unsigned NOT NULL DEFAULT '0',
  `tribe` tinyint(1) unsigned NOT NULL,
  `act` varchar(10) NOT NULL,
  `sessid` varchar(45) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `s1_users`
--


-- --------------------------------------------------------

--
-- Table structure for table `s1_vdata`
--

CREATE TABLE IF NOT EXISTS `s1_vdata` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `wref` int(10) unsigned NOT NULL,
  `owner` int(10) unsigned NOT NULL,
  `name` varchar(45) NOT NULL,
  `capital` tinyint(1) unsigned NOT NULL,
  `pop` int(10) unsigned NOT NULL,
  `maxpop` int(10) NOT NULL,
  `wood` float(12,2) NOT NULL,
  `clay` float(12,2) NOT NULL,
  `iron` float(12,2) NOT NULL,
  `maxstore` int(10) unsigned NOT NULL,
  `crop` float(12,2) NOT NULL,
  `maxcrop` int(10) unsigned NOT NULL,
  `lastupdate` int(11) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `s1_vdata`
--


-- --------------------------------------------------------

--
-- Table structure for table `s1_wdata`
--

CREATE TABLE IF NOT EXISTS `s1_wdata` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `fieldtype` tinyint(2) unsigned NOT NULL,
  `x` int(11) NOT NULL,
  `y` int(11) NOT NULL,
  `occupied` tinyint(1) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=26 ;

--
-- Dumping data for table `s1_wdata`
--

INSERT INTO `s1_wdata` (`id`, `fieldtype`, `x`, `y`, `occupied`) VALUES
(1, 1, -2, 2, 0),
(2, 1, -1, 2, 0),
(3, 11, 0, 2, 0),
(4, 1, 1, 2, 0),
(5, 1, 2, 2, 0),
(6, 1, -2, 1, 0),
(7, 1, -1, 1, 0),
(8, 2, 0, 1, 0),
(9, 1, 1, 1, 0),
(10, 1, 2, 1, 0),
(11, 1, -2, 0, 0),
(12, 3, -1, 0, 0),
(13, 2, 0, 0, 0),
(14, 1, 1, 0, 0),
(15, 1, 2, 0, 0),
(16, 2, -2, -1, 0),
(17, 1, -1, -1, 0),
(18, 1, 0, -1, 0),
(19, 1, 1, -1, 0),
(20, 3, 2, -1, 0),
(21, 3, -2, -2, 0),
(22, 3, -1, -2, 0),
(23, 3, 0, -2, 0),
(24, 3, 1, -2, 0),
(25, 3, 2, -2, 0);
 
Last edited:
Initiate Mage
Joined
Jun 28, 2005
Messages
20
Reaction score
0
Re: Actual Working Project on Travian

Error in registration ;P
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in Z:\home\dev\www\s1\include\functions.php on line 58

Fatal error: Call to a member function fetch_all() on a non-object in Z:\home\dev\www\s1\include\functions.php on line 59\

RegGlobal need on?
 
Last edited:
akakori
Joined
Apr 3, 2008
Messages
368
Reaction score
98
Re: Actual Working Project on Travian

poop... i forgot.. lol.. u guys are using the old database.. my current one is updated.. > <

use the old sql dump.. but add in the wdata.. it is still in the same format.. dont believe i changed it since then.. > <
 
Initiate Mage
Joined
Dec 7, 2009
Messages
13
Reaction score
0
Re: Actual Working Project on Travian

yes, I think when stuck on fetch_all() some how not creating a willage :) just inserting user,password,etc :)now I updating server, :)

sorry for bad english

---------- Post added at 02:44 PM ---------- Previous post was at 02:43 PM ----------

allready found info that my DB to old :D

---------- Post added at 04:19 PM ---------- Previous post was at 02:44 PM ----------

what is now wrong? error: C:\wamp\www\Travian\s1\include\functions.php on line 108,********111 ? its ewerywhere where are all resourses:grr:

---------- Post added at 04:20 PM ---------- Previous post was at 04:19 PM ----------

Notice: Undefined index: in C:\wamp\www\Travian\s1\include\functions.php on line 108
 
akakori
Joined
Apr 3, 2008
Messages
368
Reaction score
98
Re: Actual Working Project on Travian

was pre-alpha 1 so confusing? = ="

It shouldnt be THAT bad setting up.. beh.. well if u have troubles hang on to it.. wait for the alpha to come den. =)

---------- Post added at 02:13 AM ---------- Previous post was at 01:30 AM ----------

anyway thats the svn zolamu set up.. mine is the akakori_ed.. it consist of files i actively fix and uploaded onto.. although its not as updated as i hope it would be but yea.. i kinda hate the whole svn thingy.. if i replaced almost everything in a folder it would be a fag and not let me commit.. > <
 
Custom Title Activated
Member
Joined
Dec 21, 2007
Messages
1,040
Reaction score
127
Re: Actual Working Project on Travian

seeing the database structure you've posted, you're pretty much heading towards a single-server. If you could re-structure your database in order to fit BOTH multi-language AND multi-server support (such as storing all users and their general information in a table and adding a row which would show their server, doing the same for all other information). Tbh it'd be an easier way for you to control the server around :p
 
akakori
Joined
Apr 3, 2008
Messages
368
Reaction score
98
Re: Actual Working Project on Travian

seeing the database structure you've posted, you're pretty much heading towards a single-server. If you could re-structure your database in order to fit BOTH multi-language AND multi-server support (such as storing all users and their general information in a table and adding a row which would show their server, doing the same for all other information). Tbh it'd be an easier way for you to control the server around :p

U must have not been playing travian alot.. = ="
All accounts in each server there are individual and not joint. therefore a general database for user info is invalid.. Language preference could easily be added by a tinyint much later.
FYI. the tables are attached with a prefix. which allows multiple servers to run off the same database in the sql server. This is to allow host whom have limited sql database to host multi server.
 
Custom Title Activated
Member
Joined
Dec 21, 2007
Messages
1,040
Reaction score
127
Re: Actual Working Project on Travian

U must have not been playing travian alot.. = ="

nope, but I know how to login

All accounts in each server there are individual and not joint. therefore a general database for user info is invalid..

Who talked about joining accounts for each server? By adding a row (name example: ServerID) on the different data stored for the users, it'd allow an user to login ONLY to that ServerID, making it possible for the user to create and account with the same username and password/email on ANOTHER server.

Language preference could easily be added by a tinyint much later.
Organization / not wasting time.

FYI. the tables are attached with a prefix. which allows multiple servers to run off the same database in the sql server. This is to allow host whom have limited sql database to host multi server.
FYI, I noticed the prefix. Multiple server support through prefixes? lolwut? not user-friendly much..
 
akakori
Joined
Apr 3, 2008
Messages
368
Reaction score
98
Re: Actual Working Project on Travian

nope, but I know how to login



Who talked about joining accounts for each server? By adding a row (name example: ServerID) on the different data stored for the users, it'd allow an user to login ONLY to that ServerID, making it possible for the user to create and account with the same username and password/email on ANOTHER server.


Organization / not wasting time.


FYI, I noticed the prefix. Multiple server support through prefixes? lolwut? not user-friendly much..

As i said there will be an installation script.. and dude.. if u have a singular serverID,
it would defeat the purpose.. just so that u know.. > > you are able to make accounts of the same name and email. in all servers... the passwords can be different.. i personally tried it.. i have accounts using same email and username in both s5 and s10.. zzz if u have tried it.. go ahead.. else just get off this thread and work on ur own version of the source... > >
 
Banned
Banned
Joined
Jan 13, 2007
Messages
1,898
Reaction score
65
Re: Actual Working Project on Travian

in functions.php this seems not to work

Code:
	function getProduction($type) {
		global $session;
		include("resdata.php");
		switch($type) {
			case 3:
			$wood = $Woodcutter[$_SESSION['reslevel'][1]]['prod'] + $Woodcutter[$_SESSION['reslevel'][3]]['prod'] + $Woodcutter[$_SESSION['reslevel'][14]]['prod'] + $Woodcutter[$_SESSION['reslevel'][17]]['prod'];
			$clay = $Claypit[$_SESSION['reslevel'][5]]['prod'] + $Claypit[$_SESSION['reslevel'][6]]['prod'] + $Claypit[$_SESSION['reslevel'][16]]['prod'] + $Claypit[$_SESSION['reslevel'][18]]['prod'];
			$crop = $Cropland[$_SESSION['reslevel'][2]]['prod'] + $Cropland[$_SESSION['reslevel'][8]]['prod'] + $Cropland[$_SESSION['reslevel'][9]]['prod'] + $Cropland[$_SESSION['reslevel'][12]]['prod'] + $Cropland[$_SESSION['reslevel'][13]]['prod'] + $Cropland[$_SESSION['reslevel'][15]]['prod'];
			$iron = $Ironmine[$_SESSION['reslevel'][4]]['prod'] + $Ironmine[$_SESSION['reslevel'][7]]['prod'] + $Ironmine[$_SESSION['reslevel'][10]]['prod'] + $Ironmine[$_SESSION['reslevel'][11]]['prod'];
			break;
		}
 
Last edited:
akakori
Joined
Apr 3, 2008
Messages
368
Reaction score
98
Re: Actual Working Project on Travian

it doesnt work cause i have changed it since i last released it.. i used a temporary $_SESSION variable but now its part of $session class .. check out the newest version in the svn
 
Initiate Mage
Joined
Dec 28, 2008
Messages
5
Reaction score
0
Re: Actual Working Project on Travian

How do I download the current revision of
 
Status
Not open for further replies.
Back
Top