Re: [Freeciv-Dev] remove/create a player

2011-08-22 Thread Matthias Pfafferodt
Hello Michal,

could you define that exactly you want to do that is not possible at the 
moment? What code changes do you use?

Due to time limitations I'm not familiar with the development of longturn. Is 
freeciv 2.3.0 OK for games there? Or are additional patches needed?

Matthias (aka syntron)


Am Donnerstag, 18. August 2011, 14:04:23 schrieb Michal Mazurek:
 Marko pointed out some possible errors in my newcomer code. I'm trying
 to see how to reliably (possibly) remove and old (dead) player, and add
 a new one. I found this comment before server_remove_player:
 
 ./plrhand.c:1135:   This function does _not_ close any connections attached
 to this ./plrhand.c:1136:   player. The function cut_connection() is used
 for that. Be sure ./plrhand.c:1137:   to send_player_slot_info_c()
 afterwards to tell clients that the ./plrhand.c:1138:   player slot has
 become unused.
 
 Apparently there is no cut_connection() function:
 [13:56:ttypg][longturn@spock:~/src/freeciv-2.3:7]$ grep -r cut_connection .
 ./server/.svn/text-base/plrhand.c.svn-base:  player. The function
 cut_connection() is used for that. Be sure ./server/plrhand.c:  player.
 The function cut_connection() is used for that. Be sure
 
 Please advise, how do i gracefully possibly remove a non-ai player and
 add a new one, in a running game?
 
 Also, due to idlers in longturn I want to write a command to switch a
 player. Is just changing the player name sufficient? How about changing
 the nation of a player, in a running game?
 
 The reason for my commenting out the initialization code is that the
 api changed since 2.2. Thank you Marko for pointing it out!


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] remove/create a player

2011-08-22 Thread Michal Mazurek
On Mon, Aug 22, 2011 at 09:30:19PM +0200, Matthias Pfafferodt wrote:
 Hello Michal,
 
 could you define that exactly you want to do that is not possible at the 
 moment? What code changes do you use?
 
 Due to time limitations I'm not familiar with the development of longturn. Is 
 freeciv 2.3.0 OK for games there? Or are additional patches needed?

Just two things: authentication and newcomer code. Marko warned me about
the dangers of not initialising struct player properly. There is not much
documentation, so i asked. I ended up copying some code from here and
there, bugs will come out after usage :)

The outdated comment i posted in my original message added to my fear of
doing it wrong.

The lua shipped with freeciv has problems with sparc64, therefore i
prefer to write in C.

-- 
Michal Mazurek

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] remove/create a player

2011-08-22 Thread Matthias Pfafferodt
Am Montag, 22. August 2011, 21:42:12 schrieb Michal Mazurek:
 On Mon, Aug 22, 2011 at 09:30:19PM +0200, Matthias Pfafferodt wrote:
  Hello Michal,
  
  could you define that exactly you want to do that is not possible at the
  moment? What code changes do you use?
  
  Due to time limitations I'm not familiar with the development of
  longturn. Is freeciv 2.3.0 OK for games there? Or are additional patches
  needed?
 
 Just two things: authentication and newcomer code. Marko warned me about
 the dangers of not initialising struct player properly. There is not much
 documentation, so i asked. I ended up copying some code from here and
 there, bugs will come out after usage :)
 
 The outdated comment i posted in my original message added to my fear of
 doing it wrong.
 
 The lua shipped with freeciv has problems with sparc64, therefore i
 prefer to write in C.

And I did hoped to solve this problem by doing both (database backend and 
newcommer) in lua ... That problems do you have exactly? bug #18481? Are there 
other projects using lua on spac64? How do they work?

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] remove/create a player

2011-08-21 Thread Marko Lindqvist
On 18 August 2011 15:04, Michal Mazurek akf...@jasminek.net wrote:

 Please advise, how do i gracefully possibly remove a non-ai player and
 add a new one, in a running game?

 If /remove and /create are not sufficient for you, maybe you could
just adjust them instead of creating completely new command. At the
very least you can consult their implementation to see how they remove
and create player in running game (I have never even tested them
myself, nor read the code)


  - ML

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] remove/create a player

2011-08-18 Thread Michal Mazurek
Marko pointed out some possible errors in my newcomer code. I'm trying
to see how to reliably (possibly) remove and old (dead) player, and add
a new one. I found this comment before server_remove_player:

./plrhand.c:1135:   This function does _not_ close any connections attached to 
this
./plrhand.c:1136:   player. The function cut_connection() is used for that. Be 
sure
./plrhand.c:1137:   to send_player_slot_info_c() afterwards to tell clients 
that the
./plrhand.c:1138:   player slot has become unused.

Apparently there is no cut_connection() function:
[13:56:ttypg][longturn@spock:~/src/freeciv-2.3:7]$ grep -r cut_connection .
./server/.svn/text-base/plrhand.c.svn-base:  player. The function 
cut_connection() is used for that. Be sure
./server/plrhand.c:  player. The function cut_connection() is used for that. Be 
sure

Please advise, how do i gracefully possibly remove a non-ai player and
add a new one, in a running game?

Also, due to idlers in longturn I want to write a command to switch a
player. Is just changing the player name sufficient? How about changing
the nation of a player, in a running game?

The reason for my commenting out the initialization code is that the
api changed since 2.2. Thank you Marko for pointing it out!

-- 
Michal Mazurek

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev