DELTA
SVN   ĶzĶzĶz/**********************************************************************
 Freeciv - Copyright (C) 1996-2015 - Freeciv Development Team
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
***********************************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

/* common/scriptcore */
#include "luascript.h"

/* ai */
#include "aitraits.h" /* ai_trait_get_value() */

/* server/scripting */
#include "script_server.h"

#include "api_server_game_methods.h"

/*****************************************************************************
  Return the current value of an AI trait in force (base+mod)
*****************************************************************************/
int api_methods_player_trait(lua_State *L, Player *pplayer,
                             const char *trait_name)
{
  enum trait tr;

  LUASCRIPT_CHECK_STATE(L, -1);
  LUASCRIPT_CHECK_SELF(L, pplayer, -1);
  LUASCRIPT_CHECK_ARG_NIL(L, trait_name, 3, string, 0);

  tr = trait_by_name(trait_name, fc_strcasecmp);

  LUASCRIPT_CHECK_ARG(L, trait_is_valid(tr), 3, "no such trait", 0);

  return ai_trait_get_value(tr, pplayer);
}

/*****************************************************************************
  Return the current base value of an AI trait (not including Lua mod)
*****************************************************************************/
int api_methods_player_trait_base(lua_State *L, Player *pplayer,
                                  const char *trait_name)
{
  enum trait tr;

  LUASCRIPT_CHECK_STATE(L, -1);
  LUASCRIPT_CHECK_SELF(L, pplayer, -1);
  LUASCRIPT_CHECK_ARG_NIL(L, trait_name, 3, string, 0);

  tr = trait_by_name(trait_name, fc_strcasecmp);

  LUASCRIPT_CHECK_ARG(L, trait_is_valid(tr), 3, "no such trait", 0);

  return pplayer->ai_common.traits[tr].val;
}

/*****************************************************************************
  Return the current Lua increment to an AI trait
  (can be changed with api_edit_trait_mod_set())
*****************************************************************************/
int api_methods_player_trait_current_mod(lua_State *L, Player *pplayer,
                                         const char *trait_name)
{
  enum trait tr;

  LUASCRIPT_CHECK_STATE(L, -1);
  LUASCRIPT_CHECK_SELF(L, pplayer, -1);
  LUASCRIPT_CHECK_ARG_NIL(L, trait_name, 3, string, 0);

  tr = trait_by_name(trait_name, fc_strcasecmp);

  LUASCRIPT_CHECK_ARG(L, trait_is_valid(tr), 3, "no such trait", 0);

  return pplayer->ai_common.traits[tr].mod;
}

/*****************************************************************************
  Return the minimum random trait value that will be allocated for a nation
*****************************************************************************/
int api_methods_nation_trait_min(lua_State *L, Nation_Type *pnation,
                                 const char *trait_name)
{
  enum trait tr;

  LUASCRIPT_CHECK_STATE(L, -1);
  LUASCRIPT_CHECK_SELF(L, pnation, -1);
  LUASCRIPT_CHECK_ARG_NIL(L, trait_name, 3, string, 0);

  tr = trait_by_name(trait_name, fc_strcasecmp);

  LUASCRIPT_CHECK_ARG(L, trait_is_valid(tr), 3, "no such trait", 0);

  return pnation->server.traits[tr].min;
}

/*****************************************************************************
  Return the maximum random trait value that will be allocated for a nation
*****************************************************************************/
int api_methods_nation_trait_max(lua_State *L, Nation_Type *pnation,
                                 const char *trait_name)
{
  enum trait tr;

  LUASCRIPT_CHECK_STATE(L, -1);
  LUASCRIPT_CHECK_SELF(L, pnation, -1);
  LUASCRIPT_CHECK_ARG_NIL(L, trait_name, 3, string, 0);

  tr = trait_by_name(trait_name, fc_strcasecmp);

  LUASCRIPT_CHECK_ARG(L, trait_is_valid(tr), 3, "no such trait", 0);

  return pnation->server.traits[tr].max;
}

/*****************************************************************************
  Return the default trait value that will be allocated for a nation
*****************************************************************************/
int api_methods_nation_trait_default(lua_State *L, Nation_Type *pnation,
                                     const char *trait_name)
{
  enum trait tr;

  LUASCRIPT_CHECK_STATE(L, -1);
  LUASCRIPT_CHECK_SELF(L, pnation, -1);
  LUASCRIPT_CHECK_ARG_NIL(L, trait_name, 3, string, 0);

  tr = trait_by_name(trait_name, fc_strcasecmp);

  LUASCRIPT_CHECK_ARG(L, trait_is_valid(tr), 3, "no such trait", 0);

  return pnation->server.traits[tr].fixed;
}
ENDREP
DELTA
SVN   ooo/**********************************************************************
 Freeciv - Copyright (C) 1996-2015 - Freeciv Development Team
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
***********************************************************************/

#ifndef FC__API_SERVER_GAME_METHODS_H
#define FC__API_SERVER_GAME_METHODS_H

/* common/scriptcore */
#include "luascript_types.h"

/* server/scripting */
#include "api_server_edit.h"

/* Server-only methods added to the modules defined in
 * the common tolua_game.pkg. */

int api_methods_player_trait(lua_State *L, Player *pplayer,
                             const char *trait_name);
int api_methods_player_trait_base(lua_State *L, Player *pplayer,
                                  const char *trait_name);
int api_methods_player_trait_current_mod(lua_State *L, Player *pplayer,
                                         const char *trait_name);

int api_methods_nation_trait_min(lua_State *L, Nation_Type *pnation,
                                 const char *trait_name);
int api_methods_nation_trait_max(lua_State *L, Nation_Type *pnation,
                                 const char *trait_name);
int api_methods_nation_trait_default(lua_State *L, Nation_Type *pnation,
                                     const char *trait_name);

#endif /* FC__API_SERVER_GAME_METHODS_H */
ENDREP
DELTA 24832 490 329
SVN  ^.;   `Đ S-I$(top_srcdir)/aigame_methods.c	\
	api_server_game_methodsENDREP
DELTA 30061 4386 27
SVN  K Ũ;  Đ	Ų_set(lua_State *L, Player *pplayer,
                            const char *trait_name, const int mod)
{
  enum trait tr;

  LUASCRIPT_CHECK_STATE(L, -1);
  LUASCRIPT_CHECK_ARG_NIL(L, pplayer, 2, Player, FALSE);
  LUASCRIPT_CHECK_ARG_NIL(L, trait_name, 3, string, FALSE);

  tr = trait_by_name(trait_name, fc_strcasecmp);

  LUASCRIPT_CHECK_ARG(L, trait_is_valid(tr), 3, "no such trait", 0);ENDREP
DELTA 29564 507 66
SVN  08W [ W *_set(lua_State *L, Player *pplayer,
                            const char *trait_name,ENDREP
DELTA 30527 0 174
SVN  Ė2Ó[    Mq Īt§>@api_server_game_methods_set
/* Additions to common Player module. */
module Player {
  int api_methods_player_trait
    @ trait (lua_State *L, Player *pplayer, const char *trait_name);
  int api_methods_player_trait_base
    @ trait_base (lua_State *L, Player *pplayer, const char *trait_name);
  int api_methods_player_trait_current_mod
    @ trait_current_mod (lua_State *L, Player *pplayer, const char *trait_name);
}

/* Additions to common Nation_Type module. */
module Nation_Type {
  int api_methods_nation_trait_min
    @ trait_min (lua_State *L, Nation_Type *pnation, const char *trait_name);
  int api_methods_nation_trait_max
    @ trait_max (lua_State *L, Nation_Type *pnation, const char *trait_name);
  int api_methods_nation_trait_default
    @ trait_default (lua_State *L, Nation_Type *pnation,
                     const char *trait_name);
}
ENDREP
id: 31z.5qi.r30528/8422
type: file
pred: 31z.5ck.r24832/3229
count: 23
text: 30528 6815 86 1966 9ec94c87119f471ef735e9ef4d4e4f49
props: 10655 62 110 0 fdfdab56f53d2388a66f6a5ce0985f95
cpath: /branches/S2_6/server/scripting/Makefile.am
copyroot: 27474 /branches/S2_6

id: 32c.5rv.r30528/8689
type: file
pred: 32c.5rv.r30061/238652
count: 68
text: 30528 6928 417 16843 a3842442788ae9cf82f36d8ee30ec190
props: 10755 32706 110 0 fdfdab56f53d2388a66f6a5ce0985f95
cpath: /branches/S2_6/server/scripting/api_server_edit.c
copyroot: 20274 /trunk/server/scripting/api_server_edit.c

id: 32d.5rw.r30528/8996
type: file
pred: 32d.5rw.r29564/7523
count: 22
text: 30528 7372 109 3384 f508dfa40f83b83c2fba7f6d5cb02b59
props: 10395 6390 110 0 94a2a96823d3c54fff31bdd51de17982
cpath: /branches/S2_6/server/scripting/api_server_edit.h
copyroot: 20274 /trunk/server/scripting/api_server_edit.h

id: 230f.5qi.r30528/9299
type: file
count: 0
text: 30528 0 5000 4986 95f98115c8787f255006cb20e4c05ce1
cpath: /branches/S2_6/server/scripting/api_server_game_methods.c
copyroot: 27474 /branches/S2_6

id: 230i.5qi.r30528/9498
type: file
count: 0
text: 30528 5013 1789 1775 846a63d09a12297045a8d6461b1e07f5
cpath: /branches/S2_6/server/scripting/api_server_game_methods.h
copyroot: 27474 /branches/S2_6

id: 74d.5qi.r30528/9700
type: file
pred: 74d.5qi.r30527/201
count: 22
text: 30528 7507 890 10652 0c96dc135f44f5fde417059f8ccdd6fe
cpath: /branches/S2_6/server/scripting/tolua_server.pkg
copyroot: 27474 /branches/S2_6

PLAIN
K 11
Makefile.am
V 24
file 31z.5qi.r30528/8422
K 15
api_fcdb_auth.c
V 25
file 6la.5i8.r26905/61144
K 15
api_fcdb_auth.h
V 25
file 6lb.5i9.r26905/61484
K 15
api_fcdb_base.c
V 25
file 6l5.5ia.r26905/59261
K 15
api_fcdb_base.h
V 25
file 6l6.5ib.r26905/59900
K 17
api_server_base.c
V 24
file 75j.5ck.r27127/4851
K 17
api_server_base.h
V 24
file 75k.5ck.r27127/5110
K 17
api_server_edit.c
V 24
file 32c.5rv.r30528/8689
K 17
api_server_edit.h
V 24
file 32d.5rw.r30528/8996
K 25
api_server_game_methods.c
V 25
file 230f.5qi.r30528/9299
K 25
api_server_game_methods.h
V 25
file 230i.5qi.r30528/9498
K 19
api_server_notify.c
V 24
file 325.5tm.r30485/1002
K 19
api_server_notify.h
V 24
file 326.5tn.r30485/1307
K 13
script_fcdb.c
V 25
file 6l7.5ck.r26905/59601
K 13
script_fcdb.h
V 25
file 6l8.5ck.r26905/60238
K 15
script_server.c
V 23
file 328.5qx.r29718/277
K 15
script_server.h
V 25
file 329.5qy.r27544/10385
K 14
tolua_fcdb.pkg
V 25
file 6l9.5ck.r24496/13807
K 16
tolua_server.pkg
V 24
file 74d.5qi.r30528/9700
END
ENDREP
id: 31x.5qi.r30528/10941
type: dir
pred: 31x.5qi.r30527/1315
count: 264
text: 30528 9918 1010 0 fa345949482358544e73793583c8b0d2
props: 20297 0 141 0 0e1185e28fae1bc27fafb1dc5525bf7c
cpath: /branches/S2_6/server/scripting
copyroot: 27474 /branches/S2_6

PLAIN
K 11
Makefile.am
V 24
file 5q.5qi.r28430/14363
K 13
actiontools.c
V 23
file 1p8q.5qi.r30373/96
K 13
actiontools.h
V 26
file 1p8t.5qi.r28430/14182
K 8
advisors
V 24
dir 4n2.5qi.r30514/27450
K 9
aiiface.c
V 25
file 4gm.5ck.r26905/55786
K 9
aiiface.h
V 25
file 4gn.5ck.r26905/56374
K 9
animals.c
V 26
file vnk.5qi.r30222/102161
K 9
animals.h
V 25
file vnm.5ck.r26905/63257
K 6
auth.c
V 25
file 39c.5ck.r20274/32101
K 6
auth.h
V 25
file 39d.5ck.r18977/19170
K 11
barbarian.c
V 24
file lw.5qi.r29856/17671
K 11
barbarian.h
V 22
file lx.5qi.r28606/673
K 14
citizenshand.c
V 25
file 6mz.5qi.r29646/26851
K 14
citizenshand.h
V 25
file 6n0.5ck.r26905/56662
K 10
cityhand.c
V 24
file 10.5ck.r19573/66885
K 10
cityhand.h
V 23
file 4f.0.r13297/423686
K 11
citytools.c
V 22
file 4g.5qi.r30386/326
K 11
citytools.h
V 23
file 4h.5qi.r29015/8710
K 10
cityturn.c
V 22
file 4i.5qi.r30522/698
K 10
cityturn.h
V 24
file 4j.5ck.r24742/16670
K 11
civserver.c
V 24
file 4k.5qi.r30360/31178
K 10
commands.c
V 24
file 2ly.5qi.r27913/1890
K 10
commands.h
V 25
file 2lz.5qi.r28013/36715
K 13
connecthand.c
V 25
file 2dw.5qi.r29856/17933
K 13
connecthand.h
V 24
file 2dx.5ck.r23606/2057
K 9
console.c
V 24
file dd.5ck.r24895/15492
K 9
console.h
V 23
file de.5ck.r19183/7918
K 10
diplhand.c
V 23
file 4m.5qi.r30236/2316
K 10
diplhand.h
V 23
file 4n.5qi.r27518/5128
K 11
diplomats.c
V 23
file vz.5qi.r30203/2301
K 11
diplomats.h
V 23
file w0.5ck.r27461/1674
K 10
edithand.c
V 26
file 3bk.5qi.r30061/237597
K 10
edithand.h
V 25
file 4ez.5ck.r26905/64705
K 6
fcdb.c
V 25
file 6l3.5ck.r26905/56956
K 6
fcdb.h
V 25
file 6l4.5ck.r26905/57239
K 10
gamehand.c
V 25
file 4o.5qi.r30222/102422
K 10
gamehand.h
V 24
file 4p.5ck.r26564/23149
K 9
generator
V 24
dir 2me.5qi.r30514/28640
K 10
handchat.c
V 23
file 4q.5ck.r25915/6654
K 10
handchat.h
V 24
file dj.5ck.r18270/28229
K 9
maphand.c
V 25
file 13.5qi.r30222/105544
K 9
maphand.h
V 23
file 14.5ck.r24759/3742
K 6
meta.c
V 24
file 4s.5qi.r30394/46551
K 6
meta.h
V 23
file 4t.5ck.r27204/3095
K 6
mood.c
V 26
file 112c.5ck.r26905/63547
K 6
mood.h
V 26
file 112e.5ck.r26905/64129
K 8
notify.c
V 25
file 4i2.5ck.r26905/57814
K 8
notify.h
V 25
file 4i3.5ck.r26905/58681
K 9
plrhand.c
V 21
file 4u.5qi.r30295/64
K 9
plrhand.h
V 22
file 4v.5qi.r29630/442
K 8
report.c
V 23
file vi.5qi.r29900/1902
K 8
report.h
V 23
file vj.5qi.r29900/2158
K 10
rssanity.c
V 25
file hew.5qi.r30514/28898
K 10
rssanity.h
V 25
file hey.5ck.r26905/55500
K 9
ruleset.c
V 24
file 8w.5qi.r30331/26815
K 9
ruleset.h
V 24
file 8x.5qi.r30103/20281
K 13
sanitycheck.c
V 21
file wi.5qi.r30488/99
K 13
sanitycheck.h
V 24
file wj.5qi.r28076/13693
K 12
savecompat.c
V 24
file qva.5qi.r30236/2570
K 12
savecompat.h
V 24
file qvc.5qi.r30204/4618
K 10
savegame.c
V 23
file vl.5qi.r30476/1567
K 10
savegame.h
V 24
file vm.5ck.r20758/19233
K 11
savegame2.c
V 24
file 4m0.5qi.r30367/4104
K 11
savegame2.h
V 25
file 4m1.5ck.r26905/58971
K 7
score.c
V 25
file 2eg.5qi.r29646/30135
K 7
score.h
V 24
file 2eh.5ck.r21929/6179
K 9
scripting
V 24
dir 31x.5qi.r30528/10941
K 8
sernet.c
V 24
file 15.5qi.r30394/46807
K 8
sernet.h
V 23
file 4y.5ck.r23685/5129
K 10
settings.c
V 25
file 2m0.5qi.r30331/27076
K 10
settings.h
V 23
file 2m1.5qi.r29780/954
K 11
spacerace.c
V 24
file 9a.5ck.r25063/30975
K 11
spacerace.h
V 21
file 9b.0.r11338/1129
K 9
srv_log.c
V 24
file 15t.5rh.r28854/9971
K 9
srv_log.h
V 25
file 15u.5ri.r28013/36974
K 10
srv_main.c
V 21
file vg.5qi.r30489/67
K 10
srv_main.h
V 24
file vh.5qi.r29282/23936
K 11
stdinhand.c
V 24
file 4z.5qi.r30174/17327
K 11
stdinhand.h
V 24
file 50.5ck.r26100/15471
K 11
techtools.c
V 23
file 33n.5qi.r30454/545
K 11
techtools.h
V 24
file 33o.5ck.r27058/2134
K 10
unithand.c
V 23
file 18.5qi.r30203/2559
K 10
unithand.h
V 24
file 19.5ck.r23027/66151
K 11
unittools.c
V 24
file 1a.5qi.r30514/29158
K 11
unittools.h
V 23
file 1b.5qi.r29212/1520
K 8
voting.c
V 25
file 4ex.5ck.r26905/57525
K 8
voting.h
V 25
file 4ey.5ck.r26905/58399
END
ENDREP
id: z.5qi.r30528/15150
type: dir
pred: z.5qi.r30527/5520
count: 6089
text: 30528 11195 3942 0 78ef5a44ecef1f078455e26676666b79
props: 23990 448 166 0 e5026e1cb18fe57b41417951bfac7b19
cpath: /branches/S2_6/server
copyroot: 27474 /branches/S2_6

PLAIN
K 9
ABOUT-NLS
V 24
file fu.5ck.r27270/69307
K 7
AUTHORS
V 24
file 5u.5ck.r22143/14016
K 7
COPYING
V 22
file 1h.5qi.r29455/952
K 9
ChangeLog
V 26
file 6l.5ck.r27473/7455495
K 7
INSTALL
V 21
file 6.5qi.r29706/131
K 11
Makefile.am
V 23
file 59.5qi.r30174/7026
K 4
NEWS
V 24
file 6m.5ck.r25634/30702
K 6
README
V 20
file 7.0.r4421/96382
K 2
ai
V 21
dir 8.5qi.r30354/3360
K 10
autogen.sh
V 24
file 12o.5ck.r25794/4003
K 9
bootstrap
V 23
dir 2p5.5qi.r29679/3655
K 6
client
V 22
dir d.5qi.r30514/19044
K 6
common
V 22
dir p.5qi.r30514/25924
K 12
configure.ac
V 25
file 149.5qi.r30394/41396
K 4
data
V 21
dir w.5qi.r30520/6761
K 12
dependencies
V 24
dir 2yu.5qi.r30394/45765
K 3
doc
V 23
dir k7.5qi.r30311/14923
K 10
fc_version
V 23
file 2lo.5qj.r30447/150
K 11
gen_headers
V 25
dir 1hsw.5qi.r30394/46356
K 2
m4
V 23
dir 12p.5qi.r30493/2429
K 7
scripts
V 23
dir 2yo.5qi.r28717/5437
K 6
server
V 22
dir z.5qi.r30528/15150
K 5
tests
V 22
dir 2g9.5ck.r27023/734
K 5
tools
V 23
dir 4pj.5qp.r30469/2662
K 12
translations
V 26
dir t0a.5qi.r30242/5883635
K 7
utility
V 23
dir 1c.5qi.r30394/55146
K 3
vms
V 25
dir u9.5ck.r21528/1396085
K 5
win32
V 23
dir 2eu.5qi.r30466/1996
END
ENDREP
id: 3.5qi.r30528/16570
type: dir
pred: 3.5qi.r30527/6937
count: 19931
text: 30528 15394 1163 0 55afe860658138f16d15ff5bb86578ac
props: 28037 14463 292 0 9e1d5de0253c723466868990c52c129f
cpath: /branches/S2_6
copyroot: 27474 /branches/S2_6

PLAIN
K 5
S1_14
V 21
dir 3.21.r18109/18803
K 4
S2_0
V 21
dir 3.10x.r21862/4178
K 4
S2_1
V 22
dir 3.59e.r20026/11014
K 4
S2_2
V 21
dir 3.5cy.r21861/5036
K 4
S2_3
V 21
dir 3.5f2.r29458/5135
K 4
S2_4
V 22
dir 3.5ii.r30401/87429
K 4
S2_5
V 21
dir 3.5kv.r30523/6014
K 4
S2_6
V 22
dir 3.5qi.r30528/16570
K 11
freeciv-web
V 22
dir 3.5bl.r13594/14918
END
ENDREP
id: 1.0.r30528/17164
type: dir
pred: 1.0.r30527/7528
count: 10081
text: 30528 16810 341 0 7f3702d20f61bd25f890788ab03795c3
cpath: /branches
copyroot: 0 /

PLAIN
K 8
branches
V 20
dir 1.0.r30528/17164
K 4
tags
V 19
dir 2.0.r29519/6475
K 5
trunk
V 22
dir 3.5ck.r30526/16599
K 7
website
V 21
dir 3ge.0.r30021/1531
END
ENDREP
id: 0.0.r30528/17486
type: dir
pred: 0.0.r30527/7847
count: 30528
text: 30528 17319 154 0 c4b82f05cdb7aace7b247ea287f6f9d1
cpath: /
copyroot: 0 /

31z.5qi.t30527-1 modify true false /branches/S2_6/server/scripting/Makefile.am

32c.5rv.t30527-1 modify true false /branches/S2_6/server/scripting/api_server_edit.c

32d.5rw.t30527-1 modify true false /branches/S2_6/server/scripting/api_server_edit.h

_4.5qi.t30527-1 add true false /branches/S2_6/server/scripting/api_server_game_methods.c

_7.5qi.t30527-1 add true false /branches/S2_6/server/scripting/api_server_game_methods.h

74d.5qi.t30527-1 modify true false /branches/S2_6/server/scripting/tolua_server.pkg


17486 17633
