LTeX - sources

Sources of experimental LT civserver can be fetched from svn:


svn co https://pagema.net/svn/lt-civs...

user: anon
pass: anon

Sources 2.1 branch ..

svn co https://pagema.net/svn/lt-civs...

Comments

Hi, id like to add barbarian

Hi, id like to add barbarian patch to some warservers, can you pls help me with that... i want warserver with automatic addding of players durring game, so maybe u can give me the patch, i allready tried the svn, very nice.

maho's picture

Use the svn log and svn diff

Use the svn log and svn diff Luke.

If neccesary, use http://svnbook.red-bean.com/ :).

I have the svn code, i guess

I have the svn code, i guess i just need to port it to warserver... now where is pepeto :)
I got a server together (from ur svn) and it works great, its not warserver but it works. i had trouble getting ur rulset, maybe u could tar.gz it and post it, i could not find the tech.rulset files, and had to create dirs and such...

maho's picture

Just do svn log (-v) to see

Just do svn log (-v) to see what changes was made.

Use svn diff ..... > patch-name-file.diff to create patch

patch -p0 < patch-name-file.diff to patch warclient code

and ... resolve lot of conflicts - because warserver differ much in some parts of the code.

im really having to fight

im really having to fight computer to get this to work, complete details here -- http://freeciv.freeforums.org/...

maho's picture

Two notes: 1. I don't see

Two notes:

1. I don't see point to patch vanilla code with difference between vanilla code and longturn code, because you won't reach something different than longrturn code. Isn't it easier to just fetch longturn from svn?

2. but if you want to merge only some functionality, do the following:

a. svn log -v https://ssl2.pagema.net/svn/lt... |less
b. find revision range you're interested in
c. svn diff -r from:to https://ssl2.pagema.net/svn/lt... |less
d. look if it's what you wanted
d-1. if no, go back to (a)
e. do svn diff -r from:to ....... > /tmp/ee.diff
f. do cd /somewhere/freeciv-2.0.9 && patch -p0

im trying to patch longturn

im trying to patch longturn code into warserver.
it worked this time, and now it ran make with a error :
srv_main.c:110:29: error: terrain_changes.h: No such file or directory
srv_main.c: In function ‘end_turn’:
srv_main.c:660: warning: implicit declaration of function ‘update_terrain_changes’
make[3]: *** [srv_main.

emj's picture

I wont register at warserver

I wont register at warserver forum so..

Just remove the patches for aclocal/automake files, concentrate on the code just *c and *h files. Patches never work, they always need an expert masseurs dropping A-bombs to get them to work.

What you need to do is find exactly what files matter, and get the diffs for them. e.g. a svn diff of revisions 3747 and 3748 gives you the first version of his patch. Then just follow all the revs that changes those files..

There are GUI utils for this, e.g. gitk, but DON'T go down that path... Just concentrate on the code.

maho's picture

Just remove the patches for


Just remove the patches for aclocal/automake files, concentrate on the code just *c and *h files.

You're wrong. If he wants terrain changes (they are very fast now, so game will be ... ehm .. interesting :) ), then he must keep changes in autotools files.

3 maho posts in a row,

3 maho posts in a row, wow....
im not sure i need the terrain changes, all i really want is the barbarain code, then we can get it into warserver code, and hopefully we can stay closely on same page with code, and not have to spend hours porting latest barbarian code in. im gonna mess with the terrain stuff, and see if i cant use warserver terrain setup.

emj's picture

Well I'm saying that

Well I'm saying that Autotools isn't the hard part, and I'm saying that you do need too look in the code to see what isn't right.

i just pulled up kdesvn,

i just pulled up kdesvn, which i have not used in a long time, and now im exporting the rev before the terrain changes, and will patch that to warserver.

maho's picture

Note that Makefile.am files

Note that Makefile.am files changed, so you must regenerate *.in and configure

IIRC ./autogen.sh should do it.

i use that in all compiles,

i use that in all compiles, i somehow got arround this by not patching lt to freeciv --- have no idea why pepeto wanted me to do that --- maybe he thinks i am crazy... and instead patching it to warserver.

Arrgh, well now i have like

Arrgh, well now i have like 20 dirs called "patch" and another 10 with "warserver" and "trunk" and "longturn" and now im all confused =] im gonna start over.

failure... now i

failure... now i have

andrew@DellLinux:~/Patch/merged> patch -p1 < /home/andrew/Patch/patch.diff
patching file ai/aidiplomat.c
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] y
Hunk #1 FAILED at 274.
Hunk #2 FAILED at 336.
2 out of 2 hunks FAILED -- saving rejects to file ai/aidiplomat.c.rej
patching file ai/aiferry.c
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] y
Hunk #1 FAILED at 347.
1 out of 1 hunk FAILED -- saving rejects to file ai/aiferry.c.rej
patching file AUTHORS
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] y
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file AUTHORS.rej
patching file autogen.sh
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] y
Hunk #1 FAILED at 155.
1 out of 1 hunk FAILED -- saving rejects to file autogen.sh.rej
patching file bootstrap/freeciv.desktop.in
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] y
Hunk #1 FAILED at 7.
1 out of 1 hunk FAILED -- saving rejects to file bootstrap/freeciv.desktop.in.rej
patching file bootstrap/undep.sh.in
Reversed (or previously applied) patch detected! Assume -R? [n]
pls see http://freeciv.freeforums.org/...

emj's picture

Look in the rejection files,

Look in the rejection files, you have to look at what isn't working..

AUTHORS.rej *************** *

AUTHORS.rej
***************
*** 1 ****
- Please see doc/PEOPLE for a complete list.
--- 1 ----
+ Please see http://freeciv.org/wiki/People for a complete list.
i really dont see how this heps...

i think i did not patch it

i think i did not patch it right, but i do not know what went wrong... did you guys really change every file in your svn??? why do i need the patch the authors file?

maho's picture

Man ... it's very important

Man ... it's very important to read documentation for utils you're using.

Read manual for patch, or manual for svn (svn red book), and use patch and learn how to resolve conflicts, or use vendor branches in svn, and use svn merge (and learn how to resolve conflicts).

Also you could use some tools for that, I think that kdiff3 should know something about that.

patch is

patch is 70MB?????????????????????
i ran
svn diff -r 3745:3940 https://ssl2.pagema.net/svn/lt... > /home/andrew/Patch/patch/patch.diff
something wrong here????

it made the patch, i told

it made the patch, i told it
andrew@DellLinux:~/Patch/patch/merged> patch -p0 /home/andrew/Patch/patch/patch.diff
"merged" is the freeciv 2.0.9 merged with warserver.

kdiff3.... Total number of

kdiff3....

Total number of conflicts: 5
Nr of automatically solved conflicts: 0
Nr of unsolved conflicts: 5

need to merge the dirs ;(

need to merge the dirs ;(

maho's picture

hmm, on the second sight -

hmm, on the second sight - seems that you something went wrong when you patched it ... you should have terrain_changes.h

probably output of patch command should explain everything.

andrew@DellLinux:~/Patch/patc

andrew@DellLinux:~/Patch/patch> svn diff -r 3745:3940 https://ssl2.pagema.net/svn/lt... > /home/andrew/Patch/patch/patch.diff

this looks like a more sane way to do this, its running it now, then i will patch warserver... lets hope this works...
Pepeto said that he will work on porting lt code into warserver in the next release
patch is growing in size, allready 2.4 MB, i have a feeling this wont get me anywhere.

Maho, either give me the

Maho, either give me the files needed for barbarian and i can patch them in, but im not gonna waste time patching LT + freeciv into warserver, as id have to repatch all the warserver stuff again, i am sane.

maho's picture

LOL KDE, is someone making

LOL

KDE, is someone making you to patch it?.

You have everything you need to patch it. You just must learn tools to use. Sorry, but I won't tell you nothing else than svn red book and man path will.

ok, but only way i see is to

ok, but only way i see is to patch all the code and files u made, i guess i have to read 350 pages to do this, nice....

I decided not to use svn...

I decided not to use svn... so i read all the logs and concluded that these files need patch into warserver
/server/barbarian.c (from 3940)
/server/plrhand.c (from 3939)
/server/srv_main.c (from 3939)
/server/settings.c
/common/game.c
/common/game.h
/server/connecthand.c (3830)
/server/stdinhand.c (3821)
/server/stdinhand.c (3821)
and now im gonna merge them.
IF THERE are other files, pls notify me.

maho's picture

I don't know .... everything

I don't know .... everything is in svn log, if you decided not use svn ... it's your problem that you use hammer to wash you clothes and washmachine to stab nails :)

heh, it looks easier to me

heh, it looks easier to me :)

maho's picture

you're merging. when you're

you're merging. when you're merging, it's obvious that you will have conflicts. and you have to resolve the conflicts.

usually svn is helping very much in such thing. it has tools (like eclipse + subclipse) which helps even more.

But if you choose the hardest method - don't be surprized that it's hard ;)

making lots of progress, i

making lots of progress, i hope to soon be done :)

er...
make[3]: Entering directory `/home/andrew/Warserver/merged/server/generator'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/andrew/Warserver/merged/server/generator'
make[3]: Entering directory `/home/andrew/Warserver/merged/server'
gcc -g -O2 -Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -o civserver civserver.o ../utility/libcivutility.a ../common/libcivcommon.a ../ai/libcivai.a ../utility/libcivutility.a ./libcivserver.a ../utility/libcivutility.a ../common/libcivcommon.a ../ai/libcivai.a ../utility/libcivutility.a ./libcivserver.a ../utility/libcivutility.a ../common/aicore/libaicore.a ./generator/libgenerator.a -lm -lz
./libcivserver.a(connecthand.o): In function `establish_new_connection':
/home/andrew/Warserver/merged/server/connecthand.c:355: undefined reference to `create_ai_player'
/home/andrew/Warserver/merged/server/connecthand.c:356: undefined reference to `take_command'
collect2: ld returned 1 exit status
make[3]: *** [civserver] Error 1
make[3]: Leaving directory `/home/andrew/Warserver/merged/server'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/andrew/Warserver/merged/server'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/andrew/Warserver/merged'
make: *** [all] Error 2
andrew@DellLinux:~/Warserver/merged> collect2: ld returned 1 exit status
bash: collect2:: command not found
andrew@DellLinux:~/Warserver/merged
what has happened?

well, now server actualy

well, now server actualy compiles, and it runs, but it crashes when player connects with autocreate on. so more work is yet to be done, id post the patched files --- but seems i can't do that here.
[18:21:42] 2: taras has connected from 159-52-124-91.pool.ukrtel.net.
[18:21:42] 3: sending packet type=PACKET_CHAT_MSG(18) len=68
[18:21:42] 3: sending packet type=PACKET_CHAT_MSG(18) len=65
[18:21:42] 3: sending packet type=PACKET_CONN_INFO(86) len=139
[18:21:42] 3: sending packet type=PACKET_CONN_INFO(86) len=137
[18:21:42] 3: sending packet type=PACKET_CONN_INFO(86) len=139
[18:21:42] 3: sending packet type=PACKET_CHAT_MSG(18) len=59
[18:21:42] 3: sending packet type=PACKET_CHAT_MSG(18) len=45
Segmentation fault
andrew@DellLinux:~/Warserver/merged>
idlekill works --- so its a connecthand.c problem, it would appear

you can get the patch on

you can get the patch on http://freeciv.freeforums.org/...
sorry, u have to login there --- i will put it up on my site soon --- I dont leave server up overnight, however.

maho's picture

Try to debug what is the

Try to debug what is the problem.

I noticed that it sometimes crashes when there is an observer, and someone connects.

doesnt reveal anything more

doesnt reveal anything more with -d 3 parms. :( i started server, started game & then taras --- who helps work on this joined my server, and it crash when autocreate is 1

Maho, we (me and taras)are

Maho, we (me and taras)are waiting for u and kde.homelinux.net port 5555. we will leave soon if u dont connect.
edit: well, i bet u are asleep now :) since its 5am for taras, and he says he wont sleep yet =] so emj is here , we are working on debuging it.

it is now all working, just

it is now all working, just great --- see

http://freeciv.freeforums.org/...
Thanks to taras for helping find & fix the problems.

Maho, how to start debug

Maho, how to start debug with gdb and see in what function it crashes?
Can u connect KDE's server to speak?

-- Taras Kostiak.

oh man

oh man ...

http://www.hmug.org/man/1/gdb....
http://www.cs.cmu.edu/~gilpin/...

I think that it's a bit weird, when you want to patch/merge without knowledge about patch/diff/etc... tools, especially if you want use svn repository, and you're lack knowledge about svn ;). (it's to KDE).

Also, I think that it's weird if you want to debug things without knowledge about debugging :).

my short tutorial:

1. ulimit -c unlimited
2. launch civserver
3. wait until it will say segmentation fault (core dumped).
4. launch gdb (I use kdbg frontend) with server/civserver
5. load core file from debugger
6. see at what line it stopped and why.

well, its all working now...

well, its all working now... and im gonna patch my real server and people will be able to test it.

game going right now ---

game going right now --- kde.homelinux.net port 5560.

game over, it was a complete

game over, it was a complete success! all we need now is the adding of islands durring game =]

emj's picture

Post the patches!!

Post the patches!!

maho's picture

just to inform ... to post

just to inform ... to post patch here, create content->page, and add attachment.
next, contact with me and I'll publish it

it says that it does not

it says that it does not allow uploading of .tar.gz --- cause its not in its format... LOL
here is the patch--- kde.homelinux.net:81/patch.tar.gz

patching latest changes!

patching latest changes! (rev 3991)

ok, sadly, i wont be able to

ok, sadly, i wont be able to continue this work, as a matter of fact, i lost it. My desktop computers hard disk failed today, and i can't recover it, it will be some days before a replacement will come and that i will be able to reload SuSE on it, vmware and my civservers. for the meantime, does anyone remember downloading my patch? id like to have some of it recovered...

What are the main

What are the main differences from stock 2.0.x ? Is there a roadmap to changes or something similar?

maho's picture

there is no roadmap. only

there is no roadmap. only when I got some idea, I implement it.

main differences:
1. /take works even for non connected players
2. you can create player by /create command during game
3. players can be autocreated (nice feature, but unstable yet)
4. idle counter is set to zero after turn done pressed, not after someone connected.

and now I'm doing terrain changes from time to time (partially done in svn)

OK, quick question... why

OK, quick question... why are we using topology 0?

IMHO it gives an unfair advantage to the players at the edges... there were some reason for this choice?

maho's picture

Because I proposed it, and

Because I proposed it, and majority accepted it :).

I proposed it, because it's hard to orientate myself using map when it's big and wraps around. Also, it's hard to say that someone is on West and someone is on East.

emj's picture

Yes east/west terminology

Yes east/west terminology that works better now. But as he said it's a big advantage for corner players. So if e.g. marduk starts almost in a corner with a weak player he will most certainly win.

Especially if the map looks like the one in LT9, where the corners had lots of islands for trade.

mmm's picture

It seems to me from the

It seems to me from the postings I've read, that the allies you choose determine the outcome more than your start position. So if you are in center, you have the ability to unite entire region via writing/diplomacy, and can max tax/leech techs from more advanced players.

maho's picture

it's true ... but from other

it's true ...

but from other side, you have bigger chance that you will be eaten by someone in premature stage of your civilisation.

Anyway, I must remind everyone who claim that that or that is not fair the simple fact: this game isn't to be fair. This game is to be fun :).

I want to change some of the

I want to change some of the barbarian code now :-) what do i need to change to tell it to create a diffent unit for boat :D it would be better if barbarains had better boats (maybe i can add one to ruleset, it needs good defence, (keep away those subs) and high movement, can you maybe tell me what file i need to modify to set the default start unit for barbarian? also, would be nice if they got subs loaded in boat :D

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.