Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability a
Home

[Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability a

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Daniel L Speyer <dspeyer@xxxxxxxxxxx>, Reinier Post <rp@xxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Development Strategies [Was Documentation, Usability and Development]
From: Andrew Sutton <ansutton@xxxxxxx>
Date: Sun, 9 Dec 2001 10:13:49 -0500

On Saturday 08 December 2001 02:33 pm, Daniel L Speyer wrote:
> Wait a moment, if we use compiled modules, then players can't see what
> they do.  This makes unlocking-code cheats much more practical and also
> may leave some players unaware of legitimate special powers.

you mean the way it is now :) people could hack the server ruleset or the 
server and pretend its legitimate. besdides - client players shouldn't be 
able to change the rules.

that adds an interesting step to the protocol, though: negotation of rules. 
before the game starts, the players get the ruleset and get to decide vote 
whether to use it or not. the server could change some things (basic 
options). hmmm... neat :)

> Besides, writing a OS/archetechture-independant loadable module system
> sounds a lot harder than embedding a scipting language.

nah... not really. on posix systems its dlopen on win32 its LoadLibrary or 
something like that. the actual dll/so libraries are pretty much synonymous 
with a function to link, close and resolve dependencies. here's the basic 
code (this won't work for all systems, but lots of them):

// dll.h

#if defined( WIN32 )
typedef DWORD dll;
#else
typedef void *dll;
#endif

extern dll dll_open( const char *lib );
extern dll dll_sym( dll lib, const char *sym );
extern void dll_close( dll lib );

you get the idea. the source basically just #if's which api to use. things 
are fine. the actual source itself is probably only 50 lines of code - if 
that :)

andy


[Prev in Thread] Current Thread [Next in Thread]