[Freeciv-Dev] Re: Perl scripting implemented
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Wed, 25 Apr 2001, Raimar Falke wrote:
> What is XS?
In Laryy Wall's words:
An extraordinarily exported, expeditiously excellent, expressly eXternal
Subroutine, executed in existing C or C++, or in an exciting new extension
language called (exasperatingly) XS. Examine Chapter 6 [of "Programming
Perl"], Social Engineering, for the exact explanation. Exeunt.
> What kind of interface is between the civclient and the perl script?
> In what way and form the information and commands (to send certain
> packets) are exchanged?
It is not a matter of the perl script sending packets. If I wanted to
do that, I would have written a client from scratch. I wanted to provide
scripting to all the existing client implementations. I am rethinking this
strategy.
The perl script can call exported functions from Freeciv.pm. These will
usually be wrappers around the C equivalent.
If you have a look at the diff, the one useful
change-the-state-of-the-game method I implemented,
"auto_arrange_workers" was explicitly coded by sending a
PACKET_CITY_MAKE_WORKER packet on (CITY_MAP_SIZE/2,CITY_MAP_SIZE/2). I
would imagine most methods will be coded in a similar way.
> ISA? Sorry I'm only done some small scripts in perl and no OO.
Inheritance in perl.
> > If anyone would like to see some _very_ ugly diffs, I'm quite happy to
> > supply them.
> Since I won't get more stupid by looking at them: can you send them to me?
Sure. I'll send them separately.
> Raimar
Yours,
--
Peter Barker | N _--_|\ /---- Barham, Vic
Programmer,Sysadmin,Geek | W + E / /\
pbarker@xxxxxxxxxxxxxxxxxxxxx | S \_,--?_*<-- Canberra
You need a bigger hammer. | v [35S, 149E]
"Besides, what most US companies would call R&D, we call 'getting shit done'.
We're an emminently practical people in many ways."
- jeremyl@xxxxxxxxxxx on SlashDot.
|
|