<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40037 >

William Allen Simpson schrieb am 23. Jan um 04:34 Uhr:

> > - enter on GUI-console:
> > 
> > | chris: 'remove AI30'
> > | AI30 has been removed from the game.
> > | /remove: Removed player AI30 from the game.
> > | AI30 has been added as easy level AI-controlled player.
> > 
> > The AI player is removed and auto-readded immediately.
> > Instead, aifill should be reduced by 1.
> > 
> The best way would be to aifill 29.  Perhaps you mean there should be
> special code to detect that it's the last player and decrement aifill?

Yes. No. Dunno.

Looks like a race condition here. The server does what it should: it fills
up the players list with AI players. When a new human player connects, one
AI player should be removed. This does work in some cases, not in others.
Then the newcomer is "detached".

Start civclient, new game, aifill 30 (gives 1 human and 29 ai), then connect
with another client: it is "detached" (btw, the new, second client also has
command level hack, but a reduced menue in pregame screen. Intended?).

Then if you pick a nation, the server crashes:

Core was generated by `civserver -p 5556 -q 1 -e --saves ~/.freeciv/saves'.
Program terminated with signal 11, Segmentation fault.
#0  take_command (caller=0x8198f28, str=<value optimized out>, check=false)
at stdinhand.c:3018
3018      if (!pplayer->was_created && is_newgame && !pplayer->nation) {
(gdb) bt
#0  take_command (caller=0x8198f28, str=<value optimized out>, check=false)
at stdinhand.c:3018
#1  0x0805d30b in handle_stdin_input (caller=0x8198f28, str=0x8a76558 "/take
-", check=false) at stdinhand.c:3611
#2  0x080a8fa5 in handle_chat_msg_req (pconn=0x8198f28, message=0x8a76558
"/take -") at handchat.c:175
#3  0x08078ed8 in server_handle_packet (type=PACKET_CHAT_MSG_REQ,
packet=0x63, pplayer=0x0, pconn=0x8198f28)
    at hand_gen.c:39
#4  0x08051276 in server_packet_input (pconn=0x8198f28, packet=0x8a76558,
type=19) at srv_main.c:1151
#5  0x0809d86c in server_sniff_all_input () at sernet.c:395
#6  0x08053044 in srv_main () at srv_main.c:2190
#7  0x0804aaaa in main (argc=Cannot access memory at address 0x63
) at civserver.c:258
(gdb) bt
#0  take_command (caller=0x8198f28, str=<value optimized out>, check=false)
at stdinhand.c:3018
#1  0x0805d30b in handle_stdin_input (caller=0x8198f28, str=0x8a76558 "/take
-", check=false) at stdinhand.c:3611
#2  0x080a8fa5 in handle_chat_msg_req (pconn=0x8198f28, message=0x8a76558
"/take -") at handchat.c:175
#3  0x08078ed8 in server_handle_packet (type=PACKET_CHAT_MSG_REQ,
packet=0x63, pplayer=0x0, pconn=0x8198f28)
    at hand_gen.c:39
#4  0x08051276 in server_packet_input (pconn=0x8198f28, packet=0x8a76558,
type=19) at srv_main.c:1151
#5  0x0809d86c in server_sniff_all_input () at sernet.c:395
#6  0x08053044 in srv_main () at srv_main.c:2190
#7  0x0804aaaa in main (argc=Cannot access memory at address 0x63
) at civserver.c:258
(gdb)


Here a case where it works ok. See 3rd line:

Start new game, aifill 20, connect with a second client:

Welcome to the Freeciv version 2.1.3+ Server running at karl port 5556.
AI19 has been removed from the game.
AI Mode is now OFF.
You are logged in as 'chrisToo' connected to chrisToo.
/list: List of players:
/list:
/------------------------------------------------------------------------------
/list: chris (user chris, Human, Team 0, not ready) 1 connection:
/list:   chris from localhost (command access level hack), bufsize=45kb
/list: AI1 (user Unassigned, AI, difficulty level novice, Team 1)
/list: AI2 (user Unassigned, AI, difficulty level novice, Team 2)
/list: AI3 (user Unassigned, AI, difficulty level novice, Team 3)
/list: AI4 (user Unassigned, AI, difficulty level novice, Team 4)
/list: AI5 (user Unassigned, AI, difficulty level novice, Team 5)
/list: AI6 (user Unassigned, AI, difficulty level novice, Team 6)
/list: AI7 (user Unassigned, AI, difficulty level novice, Team 7)
/list: AI8 (user Unassigned, AI, difficulty level novice, Team 8)
/list: AI9 (user Unassigned, AI, difficulty level novice, Team 9)
/list: AI10 (user Unassigned, AI, difficulty level novice, Team 10)
/list: AI11 (user Unassigned, AI, difficulty level novice, Team 11)
/list: AI12 (user Unassigned, AI, difficulty level novice, Team 12)
/list: AI13 (user Unassigned, AI, difficulty level novice, Team 13)
/list: AI14 (user Unassigned, AI, difficulty level novice, Team 14)
/list: AI15 (user Unassigned, AI, difficulty level novice, Team 15)
/list: AI16 (user Unassigned, AI, difficulty level novice, Team 16)
/list: AI17 (user Unassigned, AI, difficulty level novice, Team 17)
/list: AI18 (user Unassigned, AI, difficulty level novice, Team 18)
/list: chrisToo (user chrisToo, Human, Team 20, not ready) 1 connection:
/list:   chrisToo from karl.home.cknoke.de (command access level info),
/bufsize=40kb
/list:
/------------------------------------------------------------------------------
We have control of the server (command access level hack)


Christian

-- 
Christian Knoke            * * *            http://cknoke.de
* * * * * * * * *  Ceterum censeo Microsoft esse dividendum.



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

Reply via email to