June 2003
- Damage and Stuff (Math and Code) Ben Chambers
- MMO Launch issues ruining potential segments of the market. Derek Licciardi
- MMO Launch issues ruining potential segments of the market. Mike Shaver
- MMO Launch issues ruining potential segments of the market. Daniel Anderson
- MMO Launch issues ruining potential segments of the market. Chris Holko
- MMO Launch issues ruining potential segments of the market. Matt Mihaly
- MMO Launch issues ruining potential segments of the market. Daniel.Harman@barclayscapital.com
- MMO Launch issues ruining potential segments of the market. Justin Coleman
- MMO Launch issues ruining potential segments of th e market. Daniel.Harman@barclayscapital.com
- MMO Launch issues ruining potential segments of th e market. Jeff Fuller
- MMO Launch issues ruining potential segments of the market. Matt Mihaly
- MMO Launch issues ruining potential segments of the market. Luca Girardo
- New Column by Dave Rickey "Engines of Creation" Now at Skotos Christopher Allen
- Announcing Shadow Door: an NPC Control Interface for Neverwinter Nights Robert Zubek
- ADMIN: So, what has been happening? J C Lawrence
- [Meta] Forward of moderated message J C Lawrence
- New Here MIKE MacMartin
- New Here Mike
- New Here MIKE MacMartin
On 20 Jun 2003 13:13:04 -0700
Mike <szii@sziisoft.com> wrote:
> Welcome to the list. =)
Thanks.
> Now on to your question...
> This may be a style thing, but...
> Do this. Change your while from
> while ((pos = fmt.find('$', pos + 1)), pos != string::npos) {
> to
> while (pos != string::npos) { // string::npos is -1
> pos = fmt.find('$',pos + 1);
> if (pos != string:: npos) {
> // work the string in here
> }
> }
Actually, my fix was in my CSocket::operator >> ... I made my socket class
work like iostreams, since, for all intents and purposes, that's what they
are.
I had it looking something like:
CSocket& CSocket::operator >>(string& text) {
// appropriate read call into a buffer, assigning to text
text.erase(text.length() - 1); // to get rid of \n
return *this; // to chain it like cout/cin etc.
}
If you pay attention to that code, you'll notice that it's
incomplete... what I really wanted was to get rid of newline chars
... but sometimes I get a \r\n ... and this just gets rid of the
newline.
Brace yourself: this means that it goes to the start of the line
with a character that there's no way I'd be able to get outputted.
I was drawn to this (correct) thought due to the extra characters in
the string's size.
The fix is just a simple change:
while (text[text.length() -1] == '\n' || text[text.length() - 1] == '\r')
text.erase(text.length() - 1);
Also, on the subject of scripting languages, I've embedded TCL, but
I'm thinking Ruby might be a better choice (due to the obvious
object-oriented nature of an RPG) but I've never used it. Any
thoughts?
Also, I'm expecting people to be designing game systems over top of
my library. So, I've gone and made a superclass "Functor" for the
object, which just currently makes sure they implement an
operator().
Functors, for those of you who don't know, are C++ objects that
basically look like:
struct Functor: binary_function<CCharacter&, vector<string>&, bool> {
virtual bool operator()(CCharacter& ch, vector<string>& args) {
ch.descriptor() << "Plain functor! Bug!";
return true;
}
};
I'm thinking I may want to extend it with this:
struct Functor: binary_function<CCharacter&, vector<string>&, bool> {
// operator()
int tclAPI(/* TCL args ... can't remember them */) {
// fetch the character
// break up the TCL args I get from one string to a vector<strings>
return (*this)(ch, args)? TCL_OK : TCL_ERR;
}
};
and mandating that in the constructor for the functor (odd thinking
of functions having constructors...) having a
Game::getGame().registerTCL("name", tclAPI);
... would that work? It would seem to be the best solution, as it
would almost automatically provide a TCL API for everything
implemented.
> -Mike
MIKE (yup, another mike)
--
Beware the JabberOrk
- New Here MIKE MacMartin
- Looking for a GUI Mud Development program Snicker Furfoot
- Looking for a GUI Mud Development program Ben Greear
- ADMIN: List archives are now restored. J C Lawrence
- The Price of Being Male Rayzam
- The Price of Being Male Sasha Hart
- The Price of Being Male Daniel.Harman@barclayscapital.com
- The Price of Being Male Rayzam
- The Price of Being Male Byron Ellacott
- The Price of Being Male Dr. Cat
- The Price of Being Male Castronova, Edward
- The Price of Being Male Boyle, Paul
- The Price of Being Male Mark 'Kamikaze' Hughes
- The Price of Being Male Rayzam
- The Price of Being Male Mark 'Kamikaze' Hughes
- The Price of Being Male Rayzam
- The Price of Being Male Mark 'Kamikaze' Hughes
- The Price of Being Male Marian Griffith
- The Price of Being Male Paul Schwanz
- The Price of Being Male Rayzam
- The Price of Being Male Paul Schwanz
- The Price of Being Male Vincent Archer
- The Price of Being Male Rayzam
- The Price of Being Male Castronova, Edward
- The Price of Being Male Sasha Hart
- The Price of Being Male Mark 'Kamikaze' Hughes
- The Price of Being Male Amanda Walker
- The Price of Being Male Richard A. Bartle
- The Price of Being Male Castronova, Edward
- The Price of Being Male Richard A. Bartle
- The Price of Being Male Tazzik
- The Price of Being Male Richard A. Bartle
- The Price of Being Male Tazzik
- The Price of Being Male Richard A. Bartle
- The Price of Being Male Marian Griffith
- The Price of Being Male Sasha Hart
- The Price of Being Male Tom
- The Price of Being Male Marian Griffith
- The Price of Being Male Sasha Hart
- The Price of Being Male Marian Griffith
- The Price of Being Male Sasha Hart
- The Price of Being Male Richard A. Bartle
- The Price of Being Male Castronova, Edward
- The Price of Being Male Richard A. Bartle
- The Price of Being Male Daniel.Harman@barclayscapital.com
- The Price of Being Male Paul Schwanz
- The Price of Being Male Daniel Anderson
- The Price of Being Male Travis Casey
- The Price of Being Male Paul Schwanz
- The Price of Being Male Travis Casey
- The Price of Being Male Chris Holko
- The Price of Being Male Travis Casey
- The Price of Being Male Sanvean
- The Price of Being Male Sasha Hart
- The Price of Being Male Tom
- The Price of Being Male Sanvean
- The Price of Being Male Paul Schwanz
- The Price of Being Male Amanda Walker
- The Price of Being Male shop@isparkinson.co.uk
- The Price of Being Male Boyle, Paul
- The Price of Being Male Ola Fosheim Grøstad
- The Price of Being Male Sheela Caur'Lir
- The Price of Being Male Jeff Crane
- Are gold pieces taxable? Koster, Raph
- Are gold pieces taxable? Boyle, Paul
- Are gold pieces taxable? Amanda Walker
- Are gold pieces taxable? Thomas Leavitt
- Are gold pieces taxable? Daniel.Harman@barclayscapital.com
- Functors / Loki (was: New Here) Eli Stevens
- Architecture Peter "Pietro" Rossmann
- Architecture Peter "Pietro" Rossmann
- Architecture ceo
- Architecture Peter "Pietro" Rossmann
- SW:G this is so unfair Marian Griffith
- SW:G this is so unfair Marc Bowden
- SW:G this is so unfair Martin Bassie
- Players policing themselves (was: MMO Launch issues ruining potential segments of themarket.) Derek Licciardi
- Q&A with Ken Troop, Lead Designer at Turbine Michael Tresca
- Q&A with Ken Troop, Lead Designer at Turbine Threshold RPG
- Architecture (Cell Rebalancing) Peter "Pietro" Rossmann
- Architecture (Cell Rebalancing) Zach Collins {Siege}
- Architecture (Cell Rebalancing) Peter "Pietro" Rossmann
- Architecture (Cell Rebalancing) Daniel.Harman@barclayscapital.com
- Architecture (Cell Rebalancing) Peter "Pietro" Rossmann
- Architecture (Cell Rebalancing) Rossmann Peter
- Architecture (Cell Rebalancing) ceo
- Architecture (Cell Rebalancing) Peter "Pietro" Rossmann
- Architecture (Cell Rebalancing) J C Lawrence
- Architecture (Cell Rebalancing) Peter "Pietro" Rossmann
- Architecture (Cell Rebalancing) J C Lawrence
- Architecture (Cell Rebalancing) Rossmann Peter
- Architecture (Cell Rebalancing) Rossmann Peter
- Architecture (Cell Rebalancing) J C Lawrence
- Architecture (Cell Rebalancing) Peter "Pietro" Rossmann
- Architecture (Cell Rebalancing) Daniel.Harman@barclayscapital.com
- Architecture (Cell Rebalancing) Peter "Pietro" Rossmann