antbear-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Antbear-devel] Simple questions - Class diagram


From: Daniel Ng
Subject: Re: [Antbear-devel] Simple questions - Class diagram
Date: Wed, 13 Nov 2002 08:53:11 -0800 (PST)

Hi guys,

Thanks for your questions Adam, answers in-line. If
you have any other questions, please just ask- like
they say, there's no such thing as a stupid question,
and it helps all of us to understand the project
better:

--- Adam Ferla <address@hidden> wrote:
> Hi all
> 
> I have a few questions in regards to the class
> diagram (I am fairly tired so 
> they might be stupid).
> 
> 1) Why is addConnection overriden in both
> SupporterDBase and 
> GameServerDBase? Why cant we use the ConnectionDBase
> addConnection method?

The AntBearEngine is told of a connection request from
the ABConnAdmin (AntbearEngine.decideConn()). Let's
say it is from a new Supporter. In order to decide
whether to accept the connection, the Server tries to
add the connection to the SupportersDbase (by calling
SupportersDbase.addConnection()). 

The SupportersDbase checks whether the requested
connection is in its bannedSupporters list. If it is,
then it will throw an ABDbaseException- "Tried to add
Banned Supporter" or something like that. 

AntbearEngine.decideConn() will catch this Exception
and perhaps log it, then return a boolean 'No' to the
ConnAdmin, indicating the Connection should not be
allowed.

The same sort of thing happens for the
GameServersDbase, except it may need to do something
else to check whether a connection is allowed- I'm not
sure what yet, so I gave it its own version of
addConnection() just to make the design flexible.

We could also try adding another level of abstraction,
by having a single Database 'interface' or 'gateway',
which would be the only point of interaction between
the AntbearEngine and Databases. That way, the
AntbearEngine would not need to care whether the
connection is a Gameserver or Supporter- it would
simply ask the 'interface' to store a connection.
Anyway, I'll keep it as it is for now and come back to
this idea if Database interactions get too
complicated...let me know what you think.

> 
> 2) Am I correct in stating that: the GameServerDBase
> holds information on 
> official half-life servers, 

That's right- we need to figure exactly what we want
to store from these Gameservers, but I guess it would
include the list of players on each Gameserver...

while the SupporterDBase
> contains entries for 
> antbear supporter servers 

Correct. It will actually be empty for an Antbear
which is not a Master.

plus master servers
> (specified in the 
> AntbearEngine)?

In this case the Master Server info (masterIp and
maybe I should have a masterPort too) is actually in
the AntbearEngine class.

Later on, if we decide to have a network of multiple
Masters or Antbears which are both Master&Supporters
(a major task!) we could have a 3rd database just for
Masters.

This reminds me- can a Supporter possibly share the
same Gameserver as another Supporter? If so, I guess
the Master would just choose one of these Supporters
to report on that Gameserver- right? Wow, this project
can get quite complex if we wanted it to... :)

Daniel.


> 
> Perhaps the upcomming collaboration diagram will
> answer these questions.
> 
> Cheers
> Adam Ferla
> 
> 
> 

__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2




reply via email to

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