You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(11) |
Apr
(47) |
May
(14) |
Jun
|
Jul
(73) |
Aug
(4) |
Sep
(2) |
Oct
(60) |
Nov
(48) |
Dec
(66) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
(1) |
Mar
(27) |
Apr
(82) |
May
(89) |
Jun
(91) |
Jul
(44) |
Aug
(53) |
Sep
(113) |
Oct
(20) |
Nov
(37) |
Dec
(10) |
2008 |
Jan
|
Feb
(2) |
Mar
|
Apr
(2) |
May
(21) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2009 |
Jan
(76) |
Feb
(89) |
Mar
(52) |
Apr
(11) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(27) |
2010 |
Jan
(11) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(9) |
Sep
|
Oct
|
Nov
|
Dec
(14) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(11) |
Oct
(3) |
Nov
|
Dec
|
2013 |
Jan
(4) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ult...@us...> - 2006-10-26 23:08:34
|
Revision: 160 http://svn.sourceforge.net/opengate/?rev=160&view=rev Author: ultrasick Date: 2006-10-26 16:08:24 -0700 (Thu, 26 Oct 2006) Log Message: ----------- Removed Paths: ------------- data/Gui/docked/screen - market/captions/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ult...@us...> - 2006-10-26 22:54:39
|
Revision: 159 http://svn.sourceforge.net/opengate/?rev=159&view=rev Author: ultrasick Date: 2006-10-26 15:54:27 -0700 (Thu, 26 Oct 2006) Log Message: ----------- Removed Paths: ------------- data/Logo/amanath.png data/Logo/amanath.svg data/Logo/hyperial.png data/Logo/hyperial.svg data/Logo/octavius.png data/Logo/octavius.svg data/Logo/quantar.png data/Logo/quantar.svg data/Logo/solrain.png data/Logo/solrain.svg Deleted: data/Logo/amanath.png =================================================================== (Binary files differ) Deleted: data/Logo/amanath.svg =================================================================== (Binary files differ) Deleted: data/Logo/hyperial.png =================================================================== (Binary files differ) Deleted: data/Logo/hyperial.svg =================================================================== (Binary files differ) Deleted: data/Logo/octavius.png =================================================================== (Binary files differ) Deleted: data/Logo/octavius.svg =================================================================== (Binary files differ) Deleted: data/Logo/quantar.png =================================================================== (Binary files differ) Deleted: data/Logo/quantar.svg =================================================================== (Binary files differ) Deleted: data/Logo/solrain.png =================================================================== (Binary files differ) Deleted: data/Logo/solrain.svg =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ult...@us...> - 2006-10-26 22:39:32
|
Revision: 158 http://svn.sourceforge.net/opengate/?rev=158&view=rev Author: ultrasick Date: 2006-10-26 15:37:51 -0700 (Thu, 26 Oct 2006) Log Message: ----------- Added some texts as graphics with antialiasing. Perhaps thouse image files are totally unnecessary if it is easy to handle true type fonts with c++ and may be deleted. font-family: Impact font-size: 10 or 12 (depends in which directory the file is) font-color for *normal.png files: #88D997 font-color for *selected.png files: #BAEAC3 Added Paths: ----------- data/Gui/docked/screen - market/captions/ data/Gui/docked/screen - market/captions/english/ data/Gui/docked/screen - market/captions/english/10/ data/Gui/docked/screen - market/captions/english/10/Private cargo hold.png data/Gui/docked/screen - market/captions/english/10/Private storage room.png data/Gui/docked/screen - market/captions/english/10/Public market.png data/Gui/docked/screen - market/captions/english/12/ data/Gui/docked/screen - market/captions/english/12/Capacitors - normal.png data/Gui/docked/screen - market/captions/english/12/Capacitors - selected.png data/Gui/docked/screen - market/captions/english/12/Commodities - normal.png data/Gui/docked/screen - market/captions/english/12/Commodities - selected.png data/Gui/docked/screen - market/captions/english/12/ECMs - normal.png data/Gui/docked/screen - market/captions/english/12/ECMs - selected.png data/Gui/docked/screen - market/captions/english/12/Engines - normal.png data/Gui/docked/screen - market/captions/english/12/Engines - selected.png data/Gui/docked/screen - market/captions/english/12/Guns - normal.png data/Gui/docked/screen - market/captions/english/12/Guns - selected.png data/Gui/docked/screen - market/captions/english/12/Missiles - normal.png data/Gui/docked/screen - market/captions/english/12/Missiles - selected.png data/Gui/docked/screen - market/captions/english/12/Modifications - normal.png data/Gui/docked/screen - market/captions/english/12/Modifications - selected.png data/Gui/docked/screen - market/captions/english/12/Power plants - normal.png data/Gui/docked/screen - market/captions/english/12/Power plants - selected.png data/Gui/docked/screen - market/captions/english/12/Private storage room - normal.png data/Gui/docked/screen - market/captions/english/12/Private storage room - selected.png data/Gui/docked/screen - market/captions/english/12/Radars - normal.png data/Gui/docked/screen - market/captions/english/12/Radars - selected.png data/Gui/docked/screen - market/captions/english/12/Shields - normal.png data/Gui/docked/screen - market/captions/english/12/Shields - selected.png data/Gui/docked/screen - market/captions/german/ data/Gui/docked/screen - market/captions/german/10/ data/Gui/docked/screen - market/captions/german/10/Oeffentlicher Markt.png data/Gui/docked/screen - market/captions/german/10/Privater Frachtraum.png data/Gui/docked/screen - market/captions/german/10/Privater Lagerraum.png data/Gui/docked/screen - market/captions/german/12/ data/Gui/docked/screen - market/captions/german/12/EloGM - normal.png data/Gui/docked/screen - market/captions/german/12/EloGM - selected.png data/Gui/docked/screen - market/captions/german/12/Handelswaren - normal.png data/Gui/docked/screen - market/captions/german/12/Handelswaren - selected.png data/Gui/docked/screen - market/captions/german/12/Kondensatoren - normal.png data/Gui/docked/screen - market/captions/german/12/Kondensatoren - selected.png data/Gui/docked/screen - market/captions/german/12/Modifikationen - normal.png data/Gui/docked/screen - market/captions/german/12/Modifikationen - selected.png data/Gui/docked/screen - market/captions/german/12/Privater Lagerraum - normal.png data/Gui/docked/screen - market/captions/german/12/Privater Lagerraum - selected.png data/Gui/docked/screen - market/captions/german/12/Radare - normal.png data/Gui/docked/screen - market/captions/german/12/Radare - selected.png data/Gui/docked/screen - market/captions/german/12/Raketen - normal.png data/Gui/docked/screen - market/captions/german/12/Raketen - selected.png data/Gui/docked/screen - market/captions/german/12/Reaktoren - normal.png data/Gui/docked/screen - market/captions/german/12/Reaktoren - selected.png data/Gui/docked/screen - market/captions/german/12/Schilde - normal.png data/Gui/docked/screen - market/captions/german/12/Schilde - selected.png data/Gui/docked/screen - market/captions/german/12/Triebwerke - normal.png data/Gui/docked/screen - market/captions/german/12/Triebwerke - selected.png Added: data/Gui/docked/screen - market/captions/english/10/Private cargo hold.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/10/Private cargo hold.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/10/Private storage room.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/10/Private storage room.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/10/Public market.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/10/Public market.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Capacitors - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Capacitors - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Capacitors - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Capacitors - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Commodities - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Commodities - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Commodities - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Commodities - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/ECMs - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/ECMs - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/ECMs - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/ECMs - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Engines - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Engines - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Engines - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Engines - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Guns - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Guns - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Guns - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Guns - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Missiles - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Missiles - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Missiles - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Missiles - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Modifications - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Modifications - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Modifications - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Modifications - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Power plants - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Power plants - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Power plants - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Power plants - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Private storage room - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Private storage room - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Private storage room - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Private storage room - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Radars - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Radars - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Radars - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Radars - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Shields - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Shields - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/english/12/Shields - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/english/12/Shields - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/10/Oeffentlicher Markt.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/10/Oeffentlicher Markt.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/10/Privater Frachtraum.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/10/Privater Frachtraum.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/10/Privater Lagerraum.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/10/Privater Lagerraum.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/EloGM - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/EloGM - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/EloGM - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/EloGM - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Handelswaren - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Handelswaren - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Handelswaren - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Handelswaren - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Kondensatoren - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Kondensatoren - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Kondensatoren - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Kondensatoren - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Modifikationen - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Modifikationen - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Modifikationen - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Modifikationen - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Privater Lagerraum - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Privater Lagerraum - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Privater Lagerraum - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Privater Lagerraum - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Radare - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Radare - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Radare - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Radare - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Raketen - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Raketen - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Raketen - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Raketen - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Reaktoren - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Reaktoren - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Reaktoren - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Reaktoren - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Schilde - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Schilde - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Schilde - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Schilde - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Triebwerke - normal.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Triebwerke - normal.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/captions/german/12/Triebwerke - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/captions/german/12/Triebwerke - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ult...@us...> - 2006-10-26 22:08:42
|
Revision: 157 http://svn.sourceforge.net/opengate/?rev=157&view=rev Author: ultrasick Date: 2006-10-26 15:07:36 -0700 (Thu, 26 Oct 2006) Log Message: ----------- Added some directorys and image files for the GUI which will be needed later for the market screen Added Paths: ----------- data/Gui/docked/ data/Gui/docked/screen - market/ data/Gui/docked/screen - market/buttons/ data/Gui/docked/screen - market/buttons/border - mouseout.png data/Gui/docked/screen - market/buttons/border - mouseover.png data/Gui/docked/screen - market/buttons/border - selected.png data/Gui/docked/screen - market/buttons/filling - deselected.png data/Gui/docked/screen - market/buttons/filling - selected.png data/Gui/docked/screen - market/buttons/show all/ data/Gui/docked/screen - market/buttons/show all/border - mouseout.png data/Gui/docked/screen - market/buttons/show all/border - mouseover.png data/Gui/docked/screen - market/buttons/show all/border - selected.png data/Gui/docked/screen - market/buttons/show all/mouseout.png data/Gui/docked/screen - market/buttons/show all/mouseover.png data/Gui/docked/screen - market/buttons/sort/ data/Gui/docked/screen - market/buttons/sort/alphabetically/ data/Gui/docked/screen - market/buttons/sort/alphabetically/mouseout.png data/Gui/docked/screen - market/buttons/sort/alphabetically/mouseover.png data/Gui/docked/screen - market/buttons/sort/alphabetically/selected.png data/Gui/docked/screen - market/buttons/sort/ascending/ data/Gui/docked/screen - market/buttons/sort/ascending/mouseout.png data/Gui/docked/screen - market/buttons/sort/ascending/mouseover.png data/Gui/docked/screen - market/buttons/sort/costs/ data/Gui/docked/screen - market/buttons/sort/costs/mouseout.png data/Gui/docked/screen - market/buttons/sort/costs/mouseover.png data/Gui/docked/screen - market/buttons/sort/costs/selected.png data/Gui/docked/screen - market/buttons/sort/descending/ data/Gui/docked/screen - market/buttons/sort/descending/mouseout.png data/Gui/docked/screen - market/buttons/sort/descending/mouseover.png data/Gui/docked/screen - market/buttons/sort/quantity/ data/Gui/docked/screen - market/buttons/sort/quantity/mouseout.png data/Gui/docked/screen - market/buttons/sort/quantity/mouseover.png data/Gui/docked/screen - market/buttons/sort/quantity/selected.png data/Gui/docked/screen - market/buttons/sort/rank/ data/Gui/docked/screen - market/buttons/sort/rank/mouseout.png data/Gui/docked/screen - market/buttons/sort/rank/mouseover.png data/Gui/docked/screen - market/buttons/sort/rank/selected.png data/Gui/docked/screen - market/buttons/sort/size/ data/Gui/docked/screen - market/buttons/sort/size/mouseout.png data/Gui/docked/screen - market/buttons/sort/size/mouseover.png data/Gui/docked/screen - market/buttons/sort/size/selected.png data/Gui/undocked/ Added: data/Gui/docked/screen - market/buttons/border - mouseout.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/border - mouseout.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/border - mouseover.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/border - mouseover.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/border - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/border - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/filling - deselected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/filling - deselected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/filling - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/filling - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/show all/border - mouseout.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/show all/border - mouseout.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/show all/border - mouseover.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/show all/border - mouseover.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/show all/border - selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/show all/border - selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/show all/mouseout.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/show all/mouseout.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/show all/mouseover.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/show all/mouseover.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/alphabetically/mouseout.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/alphabetically/mouseout.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/alphabetically/mouseover.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/alphabetically/mouseover.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/alphabetically/selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/alphabetically/selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/ascending/mouseout.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/ascending/mouseout.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/ascending/mouseover.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/ascending/mouseover.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/costs/mouseout.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/costs/mouseout.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/costs/mouseover.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/costs/mouseover.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/costs/selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/costs/selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/descending/mouseout.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/descending/mouseout.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/descending/mouseover.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/descending/mouseover.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/quantity/mouseout.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/quantity/mouseout.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/quantity/mouseover.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/quantity/mouseover.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/quantity/selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/quantity/selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/rank/mouseout.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/rank/mouseout.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/rank/mouseover.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/rank/mouseover.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/rank/selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/rank/selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/size/mouseout.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/size/mouseout.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/size/mouseover.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/size/mouseover.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: data/Gui/docked/screen - market/buttons/sort/size/selected.png =================================================================== (Binary files differ) Property changes on: data/Gui/docked/screen - market/buttons/sort/size/selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-10-26 21:45:39
|
Revision: 156 http://svn.sourceforge.net/opengate/?rev=156&view=rev Author: egore Date: 2006-10-26 14:45:19 -0700 (Thu, 26 Oct 2006) Log Message: ----------- add versioncheck document object extend objects for hurtability Modified Paths: -------------- ChangeLog src/client/network.h src/common/company.h src/common/faction.h src/common/objects/Makefile.am src/common/objects/movable_object.cpp src/common/objects/object.cpp src/common/objects/object.h src/server/network_meta.cpp src/server/network_meta.h Added Paths: ----------- src/common/objects/hurtable_object.cpp src/common/objects/hurtable_object.h Modified: ChangeLog =================================================================== --- ChangeLog 2006-10-26 21:30:51 UTC (rev 155) +++ ChangeLog 2006-10-26 21:45:19 UTC (rev 156) @@ -1,3 +1,14 @@ +2006-10-26 Christoph Brill <eg...@us...> + + * doc/coding-style: add information about the coding style of opengate + + * src/common/objects/hurtable_object.h, + src/common/objects/hurtable_object.cpp, src/common/objects/object.h, + src/common/objects/object.cpp: add hurtable object and document object + + * src/server/network_meta.cpp: add method for checking the version + against the metaserver + 2006-10-24 Christoph Brill <eg...@us...> * src/opengate_client.cpp: add commandline parsing and parameters for Modified: src/client/network.h =================================================================== --- src/client/network.h 2006-10-26 21:30:51 UTC (rev 155) +++ src/client/network.h 2006-10-26 21:45:19 UTC (rev 156) @@ -58,7 +58,7 @@ * PROTO_LOGIN command. * * \param username The username for the login (same as OPACMA) - * \param username The password for the login (same as OPACMA) + * \param password The password for the login (same as OPACMA) */ void login(std::string username, std::string password); @@ -77,6 +77,7 @@ /*! * This method wraps the libgrapple sending call to the server. + * \param data The data will be sent to the server. */ void send(std::string data); }; Modified: src/common/company.h =================================================================== --- src/common/company.h 2006-10-26 21:30:51 UTC (rev 155) +++ src/common/company.h 2006-10-26 21:45:19 UTC (rev 156) @@ -68,6 +68,10 @@ private: + /*! + * This method loads the XML-file and writes it to the class members. + * Before this method has been called noone should work with this class. + */ virtual void initialize(); /*! Modified: src/common/faction.h =================================================================== --- src/common/faction.h 2006-10-26 21:30:51 UTC (rev 155) +++ src/common/faction.h 2006-10-26 21:45:19 UTC (rev 156) @@ -69,12 +69,21 @@ /*! * Getter for the description of the faction. * - * \return returns a short background description of the faction (like history, population, etc.) + * \return returns a short background description of the faction (like + * history, population, etc.) */ std::string get_description(); private: + /*! + * This method loads the XML-file and writes it to the class members. + * Before this method has been called noone should work with this class. + */ virtual void initialize(); + + /*! + * The filename of the faction + */ std::string _filename; /*! Modified: src/common/objects/Makefile.am =================================================================== --- src/common/objects/Makefile.am 2006-10-26 21:30:51 UTC (rev 155) +++ src/common/objects/Makefile.am 2006-10-26 21:45:19 UTC (rev 156) @@ -2,6 +2,6 @@ METASOURCES = AUTO noinst_LTLIBRARIES = libopengate-objects.la libopengate_objects_la_SOURCES = movable_object.cpp object.cpp ship.cpp \ - station.cpp -noinst_HEADERS = movable_object.h object.h ship.h station.h + station.cpp hurtable_object.cpp +noinst_HEADERS = movable_object.h object.h ship.h station.h hurtable_object.h Added: src/common/objects/hurtable_object.cpp =================================================================== --- src/common/objects/hurtable_object.cpp (rev 0) +++ src/common/objects/hurtable_object.cpp 2006-10-26 21:45:19 UTC (rev 156) @@ -0,0 +1,48 @@ +/*************************************************************************** + * hurtable_object.cpp + * + * Thu Oct 26 22:59:31 2006 + * Copyright 2006 Christoph Brill + * Email <eg...@us...> + ****************************************************************************/ + +/* + * 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 of the License, 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "hurtable_object.h" + +HurtableObject::HurtableObject(int max_health) { + this->max_health = max_health; + this->current_health = max_health; +} + +HurtableObject::~HurtableObject() { + this->max_health = 0; + this->current_health = 0; +} + +int HurtableObject::get_health() { + return this->current_health; +} + +void HurtableObject::set_health(int health) { + this->current_health = health > max_health ? max_health : health; +} + +void HurtableObject::modify_health(int health) { + this->current_health = (this->current_health + health) > max_health ? max_health : (this->current_health + health); +} + Property changes on: src/common/objects/hurtable_object.cpp ___________________________________________________________________ Name: svn:mime-type + text/x-c++src Name: svn:eol-style + native Added: src/common/objects/hurtable_object.h =================================================================== --- src/common/objects/hurtable_object.h (rev 0) +++ src/common/objects/hurtable_object.h 2006-10-26 21:45:19 UTC (rev 156) @@ -0,0 +1,102 @@ +/*************************************************************************** + * hurtable_object.h + * + * Thu Oct 26 22:59:31 2006 + * Copyright 2006 Christoph Brill + * Email <eg...@us...> + ****************************************************************************/ + +/* + * 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 of the License, 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _OPENGATE_HURTABLE_OBJECT_ +#define _OPENGATE_HURTABLE_OBJECT_ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "object.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \brief This class defines an object, that can be destroyed. + * + * This class is an interface for all elements that can be destroyed by a + * player or something like that. A ship, for example, is hurtable. You hit + * an asteroid, your ship gets hurt and can be destroyed, so: "a ship is a + * HurtableObject" + * + * \addtogroup Common + * + * \author Christoph Brill + * \version 1.0 + * \date 2006 + */ +class HurtableObject : public Object { +public: + /*! + * This creates a hurtable object with a given health. + * \param max_health This is the maximum health of this object and also + * the initial health. + */ + HurtableObject(int max_health); + + /*! + * This destroys the object + */ + virtual ~HurtableObject(); + + /*! + * This method is used to return the health of an object. + * \return Returns the health of the object + */ + int get_health(); + + /*! + * This sets the health for the object. If it is larger than the maximum, + * the health will be set to the maximum. + * \param health The new health value to set. + */ + void set_health(int health); + + /*! + * This helps modifying the health value. You can pass positive or + * negative numbers to the method. + * \param health amount of health to gain or lose + */ + void modify_health(int health); +private: + + /*! + * The maximum health an object can have + */ + int max_health; + + /*! + * The current health an object has + */ + int current_health; +}; + +#ifdef __cplusplus +} +#endif + +#endif Property changes on: src/common/objects/hurtable_object.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native Modified: src/common/objects/movable_object.cpp =================================================================== --- src/common/objects/movable_object.cpp 2006-10-26 21:30:51 UTC (rev 155) +++ src/common/objects/movable_object.cpp 2006-10-26 21:45:19 UTC (rev 156) @@ -24,7 +24,7 @@ #include "movable_object.h" -MovableObject::MovableObject() { +MovableObject::MovableObject() : Object() { } Modified: src/common/objects/object.cpp =================================================================== --- src/common/objects/object.cpp 2006-10-26 21:30:51 UTC (rev 155) +++ src/common/objects/object.cpp 2006-10-26 21:45:19 UTC (rev 156) @@ -25,9 +25,18 @@ #include "object.h" Object::Object() { + this->position = 0; +} + +Object::Object(Ogre::Vector3 position) { + this->position = position; } Object::~ Object() { } + +Ogre::Vector3 Object::get_position() { + return this->position; +} Modified: src/common/objects/object.h =================================================================== --- src/common/objects/object.h 2006-10-26 21:30:51 UTC (rev 155) +++ src/common/objects/object.h 2006-10-26 21:45:19 UTC (rev 156) @@ -32,13 +32,53 @@ { #endif +/*! + * \brief This class defines the basic structures of an object in opengate. + * + * An object can basically anything that is found with the 3D world of + * opengate. You see an asteroid, it's an object. You see a ship, an object. + * A jumpgate, an object. Space station, object. And so on. Objects in + * general are immovable, so if you need a moveable object, you're wrong + * here. Look at MovableObject for something like that. + * + * \addtogroup Common + * + * \author Christoph Brill + * \version 1.0 + * \date 2006 + */ class Object { public: + /*! + * This creates an object. An object has a position and an orienation. + * \param position The position of the object + * FIXME: needs a parameter for the orientation, figure out what in OGRE + * can be used. + */ + Object(Ogre::Vector3 position); + + /*! + * This creates an object for that we don't know the position in space yet. + */ Object(); + + /*! + * This destroys our object. + */ virtual ~Object(); + + /*! + * This gets the position of the object + * \return The position of the object with the OGRE world. + */ Ogre::Vector3 get_position(); + private: - Ogre::Vector3 _position; + + /*! + * This variable holds the position + */ + Ogre::Vector3 position; }; #ifdef __cplusplus Modified: src/server/network_meta.cpp =================================================================== --- src/server/network_meta.cpp 2006-10-26 21:30:51 UTC (rev 155) +++ src/server/network_meta.cpp 2006-10-26 21:45:19 UTC (rev 156) @@ -1,5 +1,5 @@ /*************************************************************************** - * network_meta.h + * network_meta.cpp * * Sat Aug 31 21:04:10 2006 * Copyright 2006 Christoph Brill @@ -120,6 +120,33 @@ } int NetworkMeta::verify_version() { - // TODO: ask the server! - return 0; + std::string request = "http://" + hostname + "/script/schnittstelle/termless/version_info.php"; + + int retval = -1; + + struct MemoryStruct chunk; + + chunk.memory=NULL; /* we expect realloc(NULL, size) to work */ + chunk.size = 0; + + curl_easy_setopt(curl, CURLOPT_URL, request.c_str()); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-agent/1.0"); + + if (curl_easy_perform(curl) == 0) { + if (chunk.memory) { + std::string result = chunk.memory; + retval = result.compare(VERSION); + + std::cout << "Comparing " << result << " with " << VERSION << " gave " << retval << std::endl; + } + + } + + if (chunk.memory) { + free(chunk.memory); + } + + return retval; } Modified: src/server/network_meta.h =================================================================== --- src/server/network_meta.h 2006-10-26 21:30:51 UTC (rev 155) +++ src/server/network_meta.h 2006-10-26 21:45:19 UTC (rev 156) @@ -72,7 +72,7 @@ * meta-communication. * * \param username The username sent by the client to the server for login - * \param passwort The password sent by the client to the server for login + * \param password The password sent by the client to the server for login */ int check_login(std::string username, std::string password); @@ -82,8 +82,7 @@ * versions of the game and can talk to each other. It is part of the * meta-communication. * - * \return It returns the difference between the versions - * (for example: metaserver = 21, server = 19 -> returns 2) + * \return It returns if the version of the metaserver is larger or smaller. */ int verify_version(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-10-26 21:30:59
|
Revision: 155 http://svn.sourceforge.net/opengate/?rev=155&view=rev Author: egore Date: 2006-10-26 14:30:51 -0700 (Thu, 26 Oct 2006) Log Message: ----------- add simple document about how the code should look like Added Paths: ----------- doc/coding-style.txt Added: doc/coding-style.txt =================================================================== --- doc/coding-style.txt (rev 0) +++ doc/coding-style.txt 2006-10-26 21:30:51 UTC (rev 155) @@ -0,0 +1,88 @@ +Opengate coding style +--------------------- + +Opengate uses a common C++ coding style which will be described in this short +document. It is highly recommend to obey this style to keep the sourcecode +clean and the project up and running. There are few golden rules that I will +tell first: + +1.) alwayse use braces + +Lets take a BAD examlpe: + + i = 0; + if (false) + i++; + i += 2; + std::cout << i << std::endl; + +You see the the problem? Good. The "i += 2" call is always called but it looks +like it will only be called on the if-case. The corrected version: + + i = 0; + if (false) { + i++; + } + i += 2; + std::cout << i << std::endl; + +This is way better. So: always use braces to show where a block of code begins +and where it ends. + + +2.) document the tricky parts + +I'll be reviewing the code that will be added to the repository. If it does +something tricky, comment on it. Tell why you have done it this way. Tell how +it works in a few sentences. I'll not tolerate code that is doing "magic". I +want to know how and why it works. If I can't understand it, it won't end in +the game... unless it is documented. + + +3.) use doxygen + +I recommend documenting the source using doxygen. I know, it's bloating the +code and might even be annoying, but: It will help others, like me :-) So I +really recommend these 2 websites of the doxygen manual. The first is a short +overview the syntax [1], the second is a list of all available commands [2]. + +[1] http://www.stack.nl/~dimitri/doxygen/docblocks.html +[2] http://www.stack.nl/~dimitri/doxygen/commands.html + +4.) code example + +class Test { +public: + Test(); + ~Test(); +private: + int test; +} + +Test::Test() { + if (1 == 2) { + int i = 2; + } else { + int j = 1; + } + int k = 3; + switch (k) { + case 1: + break; + case 2: + case 3: + break; + default: + break; + } +} + +Test::~Test() { + std::cout << "end" << std::endl; +} + +I hope this example shows how the sourcecode should look like. If there are +any questions, look at the give code or ask on the mailing lists for help. + +That's it. Please follow these guidelines to help opengate getting forward. +Thanks for reading, happy programming ;-) Property changes on: doc/coding-style.txt ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-10-24 21:31:53
|
Revision: 154 http://svn.sourceforge.net/opengate/?rev=154&view=rev Author: egore Date: 2006-10-24 14:31:40 -0700 (Tue, 24 Oct 2006) Log Message: ----------- more documentation Modified Paths: -------------- src/client/network.h src/common/equipment/capacitor.h src/server/network.cpp src/server/network.h src/server/network_meta.cpp Modified: src/client/network.h =================================================================== --- src/client/network.h 2006-10-24 20:11:04 UTC (rev 153) +++ src/client/network.h 2006-10-24 21:31:40 UTC (rev 154) @@ -28,15 +28,57 @@ #include <grapple.h> #include <string> +/*! + * \brief This class is the libgrapple based client of opengate. + * + * It is used for communication to the server and between other + * clients (possibly later). + * + * \addtogroup Client + * + * \author Christoph Brill + * \version 1.0 + * \date 2006 + */ class Network { -private: - grapple_client client; - void send(std::string data); public: + /*! + * This constructor creates a client. It initializes libgrapple. + */ Network(); + + /*! + * This destructor cleans up libgrapple for a clean shutdown. + */ ~Network(); + + /*! + * This method can be used for a loging against the server which + * will then authenticate against the metaserver. This is the + * PROTO_LOGIN command. + * + * \param username The username for the login (same as OPACMA) + * \param username The password for the login (same as OPACMA) + */ void login(std::string username, std::string password); + + /*! + * This is a method for the remote shutdown of a server. This is + * the PROTO_QUIT command. + */ void quit(); + +private: + + /*! + * Handle to the libgrapple client instance. + */ + grapple_client client; + + /*! + * This method wraps the libgrapple sending call to the server. + */ + void send(std::string data); }; #endif Modified: src/common/equipment/capacitor.h =================================================================== --- src/common/equipment/capacitor.h 2006-10-24 20:11:04 UTC (rev 153) +++ src/common/equipment/capacitor.h 2006-10-24 21:31:40 UTC (rev 154) @@ -32,6 +32,19 @@ { #endif +/*! + * \brief This class defines the data for a capacitor. + * + * This class, like all other object classes, can be loaded and filled by + * by an XML-document. It defines the details for a capacitor, which is + * a component that is plugged into the ship. + * + * \addtogroup Common + * + * \author Christoph Brill + * \version 1.0 + * \date 2006 + */ class Capacitor : public Equipment { public: Capacitor(std::string filename); Modified: src/server/network.cpp =================================================================== --- src/server/network.cpp 2006-10-24 20:11:04 UTC (rev 153) +++ src/server/network.cpp 2006-10-24 21:31:40 UTC (rev 154) @@ -40,6 +40,9 @@ nwm = new NetworkMeta(); done = (nwm->verify_version() != 0); + if (done) { + std::cerr << "The server is running a different version of opengate, cannot continue! " << std::endl; + } } Network::~Network() { Modified: src/server/network.h =================================================================== --- src/server/network.h 2006-10-24 20:11:04 UTC (rev 153) +++ src/server/network.h 2006-10-24 21:31:40 UTC (rev 154) @@ -33,18 +33,76 @@ #include "network_meta.h" +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \brief This class is the libgrapple based server of opengate. + * + * It is used for communication to the client and between other + * servers. Currently it's implemented on a polling basis. + * + * \addtogroup Server + * + * \author Christoph Brill + * \version 1.0 + * \date 2006 + */ class Network { -private: - grapple_server server; - NetworkMeta* nwm; - bool done; public: + /*! + * This constructor creates a server. It initializes libgrapple + * and verifys it's running the latest version. + * + * \param max_users defines how many users may connect to this server + */ Network(int max_users); + + /*! + * This destructor cleans up libgrapple for a clean shutdown. + */ ~Network(); + + /*! + * This is currently the main function of the server. It polls libgrapples + * "incoming message box" and performs the requests by the client. + */ void pull(); + + /*! + * This method tells the server to shutdown gracefully + */ void set_done(); + + /*! + * This method tells if the server is running or not. + * + * \return Returns true, if the server is shutting down or already has been + * shut down. + */ bool is_done(); +private: + + /*! + * Handle to the libgrapple server instance. + */ + grapple_server server; + + /*! + * Handle to the metaserver connection. + */ + NetworkMeta* nwm; + + /*! + * Flag if the server is offline. + */ + bool done; }; +#ifdef __cplusplus +} #endif + +#endif Modified: src/server/network_meta.cpp =================================================================== --- src/server/network_meta.cpp 2006-10-24 20:11:04 UTC (rev 153) +++ src/server/network_meta.cpp 2006-10-24 21:31:40 UTC (rev 154) @@ -54,9 +54,6 @@ } - - - NetworkMeta::NetworkMeta() { hostname = "opacma.ontheserver.de"; curl_global_init(CURL_GLOBAL_ALL); @@ -69,14 +66,21 @@ curl_easy_cleanup(curl); } +#define LOGIN_FAILED_NO_USERNAME = -1 +#define LOGIN_FAILED_NO_PASSWORD = -2 +#define LOGIN_FAILED_USER_NOT_FOUND = -3 +#define LOGIN_FAILED_PASSWORD_INCORRECT = -4 +#define LOGIN_FAILED_NO_ACTION = -101 +#define LOGIN_FAILED_UNKOWN_ACTION = -102 + int NetworkMeta::check_login(std::string username, std::string password) { - //FIXME: the password needs some kind of encryption to protect against stolen accounts + //FIXME: the password needs some kind of client side encryption to protect against stolen accounts - //FIXME: look at http://curl.haxx.se/lxr/source/docs/examples/getinmemory.c - std::string request = "http://" + hostname + "/script/schnittstelle/?Action=login&user=" + username + "&password=" + password; + int retval = -1; + struct MemoryStruct chunk; chunk.memory=NULL; /* we expect realloc(NULL, size) to work */ @@ -86,16 +90,33 @@ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk); curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-agent/1.0"); - CURLcode res = curl_easy_perform(curl); - std::cout << "Curl result: " << res << std::endl; + if (curl_easy_perform(curl) == 0) { + if (chunk.memory) { + std::string result = chunk.memory; + std::string::size_type loc1 = result.find(";", 0 ); + if (loc1 != std::string::npos) { + std::string::size_type loc2 = result.find(";", loc1+1); + std::string userid = result.substr(0, loc1); + std::string faction = result.substr(loc1+1, loc2-(loc1+1)); + std::string lastlogin = result.substr(loc2+1); - std::cout << "Result: " << chunk.memory << std::endl; + std::cout << userid << ".." << faction << ".." << lastlogin << std::endl; - if (chunk.memory) + retval = 1; + + } else { + retval = atoi(result.c_str()); + } + } + + } + + if (chunk.memory) { free(chunk.memory); + } - return -1; + return retval; } int NetworkMeta::verify_version() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-10-24 20:11:18
|
Revision: 153 http://svn.sourceforge.net/opengate/?rev=153&view=rev Author: egore Date: 2006-10-24 13:11:04 -0700 (Tue, 24 Oct 2006) Log Message: ----------- make login work, still need to parse returned values Modified Paths: -------------- ChangeLog src/opengate_client.cpp src/opengate_server.cpp src/server/network.cpp src/server/network_meta.cpp src/server/network_meta.h Modified: ChangeLog =================================================================== --- ChangeLog 2006-10-23 21:55:52 UTC (rev 152) +++ ChangeLog 2006-10-24 20:11:04 UTC (rev 153) @@ -1,3 +1,8 @@ +2006-10-24 Christoph Brill <eg...@us...> + + * src/opengate_client.cpp: add commandline parsing and parameters for + login + 2006-10-23 Christoph Brill <eg...@us...> * src/common/company.cpp, src/common/company.h, Modified: src/opengate_client.cpp =================================================================== --- src/opengate_client.cpp 2006-10-23 21:55:52 UTC (rev 152) +++ src/opengate_client.cpp 2006-10-24 20:11:04 UTC (rev 153) @@ -43,13 +43,18 @@ #include <OISException.h> +#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 +#define DELIMITER = "--" +#else +#define DELIMITER = "--" +#endif + using namespace std; #ifdef __cplusplus extern "C" { #endif - void error_handle(std::string message) { #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 MessageBox( NULL, message.c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL); @@ -69,8 +74,43 @@ cout << "Statring up" << std::endl; cout << "-----------" << std::endl; + std::string username = "Dummy"; + std::string password = "Dummy"; + + for (int i = 1; i < argc; i++) { + std::string argument = argv[i]; + std::string::size_type loc_delim = argument.find("--", 0 ); + if (loc_delim != string::npos) { + std::string::size_type loc_value = argument.find("=", 0 ); + if (loc_delim != string::npos) { + std::string param = argument.substr(loc_delim+2, loc_value-(loc_delim+2)); + std::string value = argument.substr(loc_value+1); + + if (param.compare("user") == 0) { + username = value; + } else if (param.compare("password") == 0) { + password = value; + } else if (param.compare("help") == 0) { + std::cout << "Opengate " << VERSION << std::endl; + std::cout << "---------------" << std::endl; + std::cout << "Arguments:" << std::endl; + std::cout << " --user: Define the username for login" << std::endl; + std::cout << " --password: Define the password for login" << std::endl; + } else { + std::cout << "Argument " << param << " is unkown, ignoring it." << std::endl; + } + } else { + cout << "Didn't find Value" << endl; + } + } else { + cout << "Didn't find delimiter" << endl; + } + } + + std::cout << username << password << std::endl; + Network* nw = new Network(); - nw->login("egore911", "dexter"); + nw->login(username, password); /* Loader* loader = new Loader(); loader->parse_file("money.xml"); Modified: src/opengate_server.cpp =================================================================== --- src/opengate_server.cpp 2006-10-23 21:55:52 UTC (rev 152) +++ src/opengate_server.cpp 2006-10-24 20:11:04 UTC (rev 153) @@ -50,6 +50,7 @@ nw = new Network(2); while (!nw->is_done()) { + std::cout << "We're done!" << std::endl; nw->pull(); sleep(1); } Modified: src/server/network.cpp =================================================================== --- src/server/network.cpp 2006-10-23 21:55:52 UTC (rev 152) +++ src/server/network.cpp 2006-10-24 20:11:04 UTC (rev 153) @@ -22,9 +22,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "network.h" + #include <iostream> #include <string> -#include "network.h" #include "../common/network_protocol.h" Network::Network(int max_users) { @@ -38,7 +39,7 @@ grapple_server_maxusers_set(server, max_users); nwm = new NetworkMeta(); - done = !nwm->verify_version(); + done = (nwm->verify_version() != 0); } Network::~Network() { Modified: src/server/network_meta.cpp =================================================================== --- src/server/network_meta.cpp 2006-10-23 21:55:52 UTC (rev 152) +++ src/server/network_meta.cpp 2006-10-24 20:11:04 UTC (rev 153) @@ -24,7 +24,39 @@ #include "network_meta.h" #include <iostream> +#include <string> + +struct MemoryStruct { + char *memory; + size_t size; +}; + +void *myrealloc(void *ptr, size_t size) { + /* There might be a realloc() out there that doesn't like reallocing NULL pointers, so we take care of it here */ + if(ptr) + return realloc(ptr, size); + else + return malloc(size); +} + +size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) { + size_t realsize = size * nmemb; + struct MemoryStruct *mem = (struct MemoryStruct *)data; + + mem->memory = (char *)myrealloc(mem->memory, mem->size + realsize + 1); + if (mem->memory) { + memcpy(&(mem->memory[mem->size]), ptr, realsize); + mem->size += realsize; + mem->memory[mem->size] = 0; + } + return realsize; +} + + + + + NetworkMeta::NetworkMeta() { hostname = "opacma.ontheserver.de"; curl_global_init(CURL_GLOBAL_ALL); @@ -39,18 +71,34 @@ int NetworkMeta::check_login(std::string username, std::string password) { + //FIXME: the password needs some kind of encryption to protect against stolen accounts + //FIXME: look at http://curl.haxx.se/lxr/source/docs/examples/getinmemory.c std::string request = "http://" + hostname + "/script/schnittstelle/?Action=login&user=" + username + "&password=" + password; - std::cout << request << std::endl; + struct MemoryStruct chunk; + chunk.memory=NULL; /* we expect realloc(NULL, size) to work */ + chunk.size = 0; + curl_easy_setopt(curl, CURLOPT_URL, request.c_str()); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-agent/1.0"); CURLcode res = curl_easy_perform(curl); + std::cout << "Curl result: " << res << std::endl; + + std::cout << "Result: " << chunk.memory << std::endl; + + if (chunk.memory) + free(chunk.memory); + + return -1; } -bool NetworkMeta::verify_version() { +int NetworkMeta::verify_version() { // TODO: ask the server! - return true; + return 0; } Modified: src/server/network_meta.h =================================================================== --- src/server/network_meta.h 2006-10-23 21:55:52 UTC (rev 152) +++ src/server/network_meta.h 2006-10-24 20:11:04 UTC (rev 153) @@ -30,26 +30,79 @@ #endif #include <stdio.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <netdb.h> -#include <string.h> #include <string> #include <curl/curl.h> -#define BUFFER_SIZE 512 +#ifdef __cplusplus +extern "C" { +#endif +/*! + * \brief This class handles the communication from the server to a HTTP-meta-server. + * + * All stuff that needs communication between the server and a metaserver is + * handled here. This so called "stuff" can be anything from the verification + * of the login of a user or informations about the list of active servers + * to current news or economic stuff like prices, availability of products, etc. + * + * \addtogroup Server + * + * \author Christoph Brill + * \version 1.0 + * \date 2006 + */ class NetworkMeta { public: + + /*! + * This constructor initializes the networking to the metaserver. It initializes + * libcurl and sets a default hostname of the metaserver. + */ NetworkMeta(); + + /*! + * This destructor destroys the communication of the meta-server by cleaning up + * libcurl + */ ~NetworkMeta(); + + /*! + * This function passes the arguments given to the metaserver for getting the + * login-result which is performed against a database. It is part of the + * meta-communication. + * + * \param username The username sent by the client to the server for login + * \param passwort The password sent by the client to the server for login + */ int check_login(std::string username, std::string password); - bool verify_version(); + + /*! + * This function allows the server to verify it is running the latest version. It + * should be run on server startup to guarantee that all server run identical + * versions of the game and can talk to each other. It is part of the + * meta-communication. + * + * \return It returns the difference between the versions + * (for example: metaserver = 21, server = 19 -> returns 2) + */ + int verify_version(); + private: + + /*! + * This variable stores the name of the host we use as metaserver + */ std::string hostname; - bool perform_request(std::string request, char* buffer); + + /*! + * This variable holds the reference to curl for communication + */ CURL *curl; }; +#ifdef __cplusplus +} #endif + + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-10-23 21:56:20
|
Revision: 152 http://svn.sourceforge.net/opengate/?rev=152&view=rev Author: egore Date: 2006-10-23 14:55:52 -0700 (Mon, 23 Oct 2006) Log Message: ----------- use libcurl (currently broken!) update few XML-files from website add comments to some files add more loading-mechanisms completely break network_meta (no authetication against meta-server possible!) Modified Paths: -------------- ChangeLog aclocal.m4 configure.in data/Components/aluminium.xml data/Components/antimony.xml data/Components/copper.xml data/Components/cpu.xml data/Components/gold.xml data/Components/laser_components.xml data/Components/ram.xml src/common/company.cpp src/common/company.h src/common/faction.cpp src/common/faction.h src/common/faction_storage.cpp src/common/faction_storage.h src/common/loader.cpp src/common/loader.h src/common/objects/ship.cpp src/opengate_client.cpp src/server/network.h src/server/network_meta.cpp src/server/network_meta.h Modified: ChangeLog =================================================================== --- ChangeLog 2006-09-02 09:12:15 UTC (rev 151) +++ ChangeLog 2006-10-23 21:55:52 UTC (rev 152) @@ -1,3 +1,17 @@ +2006-10-23 Christoph Brill <eg...@us...> + + * src/common/company.cpp, src/common/company.h, + src/common/objects/station.cpp, src/common/objects/station.h: more + XML-loading-work + + * src/common/faction.h, src/common/faction_storage.h: doxygen for + documentation + +2006-10-18 Christoph Brill <eg...@us...> + + * src/server/network_meta.cpp, src/server/network_meta.h: try porting + the login mechanism to the new server-infrastructure without success + 2006-09-02 Christoph Brill <eg...@us...> * src/server/network.h, src/server/network.cpp, Modified: aclocal.m4 =================================================================== --- aclocal.m4 2006-09-02 09:12:15 UTC (rev 151) +++ aclocal.m4 2006-10-23 21:55:52 UTC (rev 152) @@ -6606,7 +6606,8 @@ _PKG_TEXT ])], - [$4]) + [AC_MSG_RESULT([no]) + $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it Modified: configure.in =================================================================== --- configure.in 2006-09-02 09:12:15 UTC (rev 151) +++ configure.in 2006-10-23 21:55:52 UTC (rev 152) @@ -36,6 +36,10 @@ AM_CXXFLAGS="$AM_CXXFLAGS $LIBXML2_CFLAGS" AM_LDFLAGS="$AM_LDFLAGS $LIBXML2_LIBS" +#libcurl - http://curl.haxx.se/libcurl/ +PKG_CHECK_MODULES(LIBCURL, [libcurl >= 7.5]) +AM_CXXFLAGS="$AM_CXXFLAGS $LIBCURL_CFLAGS" +AM_LDFLAGS="$AM_LDFLAGS $LIBCURL_LIBS" AC_SUBST(AM_CXXFLAGS, "$AM_CXXFLAGS") AC_SUBST(AM_LDFLAGS, "$AM_LDFLAGS") Modified: data/Components/aluminium.xml =================================================================== (Binary files differ) Modified: data/Components/antimony.xml =================================================================== (Binary files differ) Modified: data/Components/copper.xml =================================================================== (Binary files differ) Modified: data/Components/cpu.xml =================================================================== (Binary files differ) Modified: data/Components/gold.xml =================================================================== (Binary files differ) Modified: data/Components/laser_components.xml =================================================================== (Binary files differ) Modified: data/Components/ram.xml =================================================================== (Binary files differ) Modified: src/common/company.cpp =================================================================== --- src/common/company.cpp 2006-09-02 09:12:15 UTC (rev 151) +++ src/common/company.cpp 2006-10-23 21:55:52 UTC (rev 152) @@ -23,15 +23,27 @@ */ #include "company.h" +#include "loader.h" -Company::Company(std::string name) { - _name = name; +Company::Company(std::string filename) { + _filename = filename; + initialize(); } Company::~Company() { } +void Company::initialize() { + + Loader* loader = Loader::get_instance(); + loader->parse_file(_filename); + + // Naming + _name = loader->get_option("/company/name"); + +} + std::string Company::get_name() { return _name; } Modified: src/common/company.h =================================================================== --- src/common/company.h 2006-09-02 09:12:15 UTC (rev 151) +++ src/common/company.h 2006-10-23 21:55:52 UTC (rev 152) @@ -25,18 +25,65 @@ #ifndef _OPENGATE_COMPANY_ #define _OPENGATE_COMPANY_ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <string> +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \brief This class defines a company in opengate. + * + * There are several companies in opengate. Which company produced a component + * is currently completely irrelevant, but will later be used for the economic + * calculations. + * + * \author Christoph Brill + * \version 1.0 + * \date 2006 + */ class Company { public: - Company(std::string name); + /*! + * This creates a company by loading it from a file based by it's filename. + * \param filename The relative path from the base datadir to the file + */ + Company(std::string filename); + + /*! + * This destroys the company. + */ virtual ~Company(); + /*! + * Getter for the name of the company. + * + * \return returns the name of the company (i.e. "T&P Systems") + */ std::string get_name(); private: + + virtual void initialize(); + + /*! + * The name of the company + */ std::string _name; + /*! + * The filename of the company + */ + std::string _filename; + }; +#ifdef __cplusplus +} #endif + +#endif /* _OPENGATE_COMPANY_ */ Modified: src/common/faction.cpp =================================================================== --- src/common/faction.cpp 2006-09-02 09:12:15 UTC (rev 151) +++ src/common/faction.cpp 2006-10-23 21:55:52 UTC (rev 152) @@ -23,15 +23,27 @@ */ #include "faction.h" +#include "loader.h" -Faction::Faction(std::string name) { - _name = name; - _description = std::string(""); +Faction::Faction(std::string filename) { + _filename = filename; + initialize(); } Faction::~Faction() { } +void Faction::initialize() { + + Loader* loader = Loader::get_instance(); + loader->parse_file(_filename); + + // Naming + _name = loader->get_option("/faction/name"); + _description = loader->get_option("/faction/description"); + +} + std::string Faction::get_name() { return _name; } Modified: src/common/faction.h =================================================================== --- src/common/faction.h 2006-09-02 09:12:15 UTC (rev 151) +++ src/common/faction.h 2006-10-23 21:55:52 UTC (rev 152) @@ -25,34 +25,72 @@ #ifndef _OPENGATE_FACTION_ #define _OPENGATE_FACTION_ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <string> -/** - * This class defines the basic structures for a faction in opengate. A faction - * is for example "Solrain". +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \brief This class defines the basic structures for a faction in opengate. * - * @author Christoph Brill + * A faction is for example "Solrain". A faction has a short description and + * a name. That's all for now. + * + * \author Christoph Brill + * \version 1.0 + * \date 2006 */ class Faction { public: - Faction(std::string name); + /*! + * This constructor "creates" a faction. Actually a faction is loaded + * from a file so that passing the filename will load the details. + * \param filename The relative path from the base datadir to the file + */ + Faction(std::string filename); + + /*! + * This deletes the faction. Since nothing has been done with a faction + * it is normally discarded. + */ ~Faction(); - /** + /*! * Getter for the name of the faction. - * - * @return returns the name of the faction (i.e. "Octavius") + * + * \return returns the name of the faction (i.e. "Octavius") */ std::string get_name(); - /** + /*! * Getter for the description of the faction. - * - * @return returns a short background description of the faction (like history, population, etc.) + * + * \return returns a short background description of the faction (like history, population, etc.) */ std::string get_description(); private: + + virtual void initialize(); + std::string _filename; + + /*! + * The name of the faction + */ std::string _name; + + /*! + * The short description of the faction + */ std::string _description; }; +#ifdef __cplusplus +} #endif + +#endif /* _OPENGATE_FACTION_ */ + Modified: src/common/faction_storage.cpp =================================================================== --- src/common/faction_storage.cpp 2006-09-02 09:12:15 UTC (rev 151) +++ src/common/faction_storage.cpp 2006-10-23 21:55:52 UTC (rev 152) @@ -25,7 +25,8 @@ #include "faction_storage.h" #include "exception.h" -FactionStorage* FactionStorage::_storage_instance = NULL; +// Take care the singleton-member-variable is set to 0 at startup +FactionStorage* FactionStorage::_storage_instance = 0; FactionStorage::FactionStorage() { @@ -38,30 +39,30 @@ } } -Faction* FactionStorage::get_faction(std::string faction_name) { - if (!storage_contains(faction_name)) { - Faction* faction = new Faction(faction_name); +Faction* FactionStorage::get_faction(std::string faction_filename) { + if (!storage_contains(faction_filename)) { + Faction* faction = new Faction(faction_filename); data.push_back(faction); data.sort(); return faction; } - return find_faction(faction_name); + return find_faction(faction_filename); } -bool FactionStorage::storage_contains(std::string faction_name) { +bool FactionStorage::storage_contains(std::string faction_filename) { std::list<Faction*>::const_iterator iter; for (iter = data.begin(); iter != data.end(); iter++) { - if (((Faction*)*iter)->get_name() == faction_name) { + if (((Faction*)*iter)->get_name() == faction_filename) { return true; } } return false; } -Faction* FactionStorage::find_faction(std::string faction_name) { +Faction* FactionStorage::find_faction(std::string faction_filename) { std::list<Faction*>::const_iterator iter; for (iter = data.begin(); iter != data.end(); iter++) { - if (((Faction*)*iter)->get_name() == faction_name) { + if (((Faction*)*iter)->get_name() == faction_filename) { return (Faction*)*iter; } } Modified: src/common/faction_storage.h =================================================================== --- src/common/faction_storage.h 2006-09-02 09:12:15 UTC (rev 151) +++ src/common/faction_storage.h 2006-10-23 21:55:52 UTC (rev 152) @@ -25,26 +25,100 @@ #ifndef _OPENGATE_FACTION_STORAGE_ #define _OPENGATE_FACTION_STORAGE_ -#include "faction.h" +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <list> #include <string> +#include "faction.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + * \brief This class defines a loader for the factions in Opengate + * + * If you need a faction, use this class to load it. It is able to + * load a faction from it's XML-file and give it to you. It implements + * the "Singleton" design pattern so you just need to call get_instance() + * to get a valid faction storage. + * + * \author Christoph Brill + * \version 1.0 + * \date 2006 + */ class FactionStorage { public: - FactionStorage(); + /*! + * This destructes the storage and all stored factions with it. + */ ~FactionStorage(); + + /*! + * This method return the only instance of the faction storage. + * If you need one, use this method and don't create a new one. + * \return Returns the only instance of FactionStorage + */ inline static FactionStorage* get_instance() { - if (_storage_instance == NULL) { + if (_storage_instance == 0) { _storage_instance = new FactionStorage(); } return _storage_instance; } - Faction* get_faction(std::string faction_name); - bool storage_contains(std::string faction_name); - Faction* find_faction(std::string faction_name); + + /*! + * Get a faction by it's name. If the faction has been already + * loaded it is returned. If noone wanted it yet it is loaded + * from XML (using the Factions constructor). + * \param faction_filename Filename of the faction we want + * \return The faction as loaded from it's file + */ + Faction* get_faction(std::string faction_filename); + + /*! + * This method tests if a faction has been loaded. In most cases + * it's only instersing for internal cases, but if someone wants + * to know, here you can find the info. + * \param faction_filename Filename of the faction we want to know if it + * was loaded + * \return Returns true, if the Faction was loaded before + */ + bool storage_contains(std::string faction_filename); + + /*! + * This method works more or less like the get_faction()-method. + * The main (and important) difference is, that a faction is not + * loaded from a file if it was not found. If it wasn't found, + * an exception is thrown, so beware of messing with it. + * \param faction_filename Filename of the faction we want + * \return Returns the faction if found + */ + Faction* find_faction(std::string faction_filename); private: + + /*! + * This is the (currently) emtpy constructor of this storage. Noting + * is allocated, noting is done. + */ + FactionStorage(); + + /*! + * This it the variable that hold the single instance of the faction + * storage. It will be set to 0 in the corresponding cpp-file. + */ static FactionStorage* _storage_instance; + + /*! + * This variable holds the list of factions that have been loaded. + */ std::list<Faction*> data; }; +#ifdef __cplusplus +} #endif + +#endif /* _OPENGATE_FACTION_STORAGE_ */ Modified: src/common/loader.cpp =================================================================== --- src/common/loader.cpp 2006-09-02 09:12:15 UTC (rev 151) +++ src/common/loader.cpp 2006-10-23 21:55:52 UTC (rev 152) @@ -25,13 +25,14 @@ #include "loader.h" #include "exception.h" -Loader* Loader::_loader_instance = NULL; +Loader* Loader::_loader_instance = 0; + Loader::Loader() { - root_doc = NULL; - root_context = NULL; + root_doc = 0; + root_context = 0; - /* Init libxml */ + // Init libxml xmlInitParser(); LIBXML_TEST_VERSION; } Modified: src/common/loader.h =================================================================== --- src/common/loader.h 2006-09-02 09:12:15 UTC (rev 151) +++ src/common/loader.h 2006-10-23 21:55:52 UTC (rev 152) @@ -25,6 +25,10 @@ #ifndef _OPENGATE_LOADER_ #define _OPENGATE_LOADER_ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <libxml/parser.h> #include <libxml/tree.h> #include <libxml/xpath.h> @@ -36,28 +40,100 @@ { #endif +/*! + * \brief This class loads XML-files using libxml2. + * + * This is one of the key-parts of opengate. It is able to load a XML-file + * and provice it's contents to other classes. It also validates the XML-file + * so that only valid content is loaded. It implements the "Singleton"-Design- + * Pattern so we don't have multiple loaders. + * + * \author Christoph Brill + * \version 1.0 + * \date 2006 + */ class Loader { public: - Loader(); + + /*! + * This unloads a possibly loaded document and shuts down the + * libxml2-parser + */ ~Loader(); + + /*! + * This returns the single instance of the loader + * \return the single instance of the loader. + */ inline static Loader* get_instance() { - if (_loader_instance == NULL) { + if (_loader_instance == 0) { _loader_instance = new Loader(); } return _loader_instance; } + + /*! + * This parses a file based on it's filename. It is loaded from the + * filesystem and parsed into a X-Path-Model to read the values + * from there. + * \param filename The filename to load the XML-document from + */ void parse_file(std::string filename); + + /*! + * Reads an option from an XML-document parsed into the X-Path-Model. + * All options are returned as string. + * \param path The name of the value (for example: "/ship/name") + * \return The value of the path as string (for example "Premia") + */ char* get_option(char* path); - std::vector<char*> get_option_array(char* path); //TODO: return array! + + /*! + * Reads an option from an XML-document parsed into the X-Path-Model. + * All options are returned as std::vector of string. + * \param path The name of the value (for example: "/ship/production-center") + * \return The value of the path as std::vector of string + */ + std::vector<char*> get_option_array(char* path); + + /*! + * Get the count of the options found under a X-Path. This can be used + * to read an array with get_option_array. + * \param path The name of the value (for example: "/ship/production-center") + * \return Returns the number of values found at the path, i.e. 3 + */ int get_option_count(char* path); + + /*! + * Sets an option at a given path. This can be used for runtime-modifications of + * the X-Path-Model and later for saving the XML-file. It is currently limited to + * storing non-array-pathes. + * \param path The name of the value (for example: "/ship/name") + * \param value The value for the path as string (for example "Premia") + */ void set_option(char* path, const char* value); private: + + /*! + * This instantiates the loader. It takes care that the document + * is empty. It also initializes libxml2 and verifies the version. + */ + Loader(); + + /*! + * Variable to store the single instance of the Loader + */ static Loader* _loader_instance; - /** the resulting document tree */ + /*! + * The resulting document tree + */ xmlDocPtr root_doc; - /** the x-path context */ + + /*! + * The x-path context + */ xmlXPathContext* root_context; /** @@ -65,10 +141,13 @@ * they exist. */ void clean_parser(); + /** * This method gets an x-path (see http://www.w3schools.com/xpath/xpath_examples.asp for examples) * and evaluates if there is a possible value. If so, the value is returned. Otherwise an exception * is thrown. + * \param path The name of the value (for example: "/ship/name") + * \return Returns the value */ xmlNodeSet* evaluate_xpath(char* path); }; Modified: src/common/objects/ship.cpp =================================================================== --- src/common/objects/ship.cpp 2006-09-02 09:12:15 UTC (rev 151) +++ src/common/objects/ship.cpp 2006-10-23 21:55:52 UTC (rev 152) @@ -29,7 +29,6 @@ #include <vector> Ship::Ship(std::string filename) { - // TODO: intialize the variables _filename = filename; initialize(); } Modified: src/opengate_client.cpp =================================================================== --- src/opengate_client.cpp 2006-09-02 09:12:15 UTC (rev 151) +++ src/opengate_client.cpp 2006-10-23 21:55:52 UTC (rev 152) @@ -70,7 +70,7 @@ cout << "-----------" << std::endl; Network* nw = new Network(); - nw->login("XXX", "YYY"); + nw->login("egore911", "dexter"); /* Loader* loader = new Loader(); loader->parse_file("money.xml"); Modified: src/server/network.h =================================================================== --- src/server/network.h 2006-09-02 09:12:15 UTC (rev 151) +++ src/server/network.h 2006-10-23 21:55:52 UTC (rev 152) @@ -30,6 +30,7 @@ #endif #include <grapple.h> + #include "network_meta.h" class Network { Modified: src/server/network_meta.cpp =================================================================== --- src/server/network_meta.cpp 2006-09-02 09:12:15 UTC (rev 151) +++ src/server/network_meta.cpp 2006-10-23 21:55:52 UTC (rev 152) @@ -22,117 +22,32 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <network_meta.h> - +#include "network_meta.h" #include <iostream> NetworkMeta::NetworkMeta() { - hostname = "opengate.sourceforge.net"; + hostname = "opacma.ontheserver.de"; + curl_global_init(CURL_GLOBAL_ALL); + curl = curl_easy_init(); + //curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1); + //curl_easy_setopt(curl, CURLOPT_MUTE, 1); } -bool NetworkMeta::perform_request(std::string request, char* buffer) { - - int sd; - struct sockaddr_in sin; - struct sockaddr_in pin; - struct hostent *hp; - - /* go find out about the desired host machine */ - if ((hp = gethostbyname(hostname.c_str())) == 0) { - perror("gethostbyname"); - return false; - } - - /* fill in the socket structure with host information */ - memset(&pin, 0, sizeof(pin)); - pin.sin_family = AF_INET; - pin.sin_addr.s_addr = ((struct in_addr *)(hp->h_addr))->s_addr; - pin.sin_port = htons(80); - - /* grab an Internet domain socket */ - if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { - perror("socket"); - return false; - } - - /* connect to PORT on HOST */ - if (connect(sd,(struct sockaddr *) &pin, sizeof(pin)) == -1) { - perror("connect"); - return false; - } - - /* send a message to the server PORT on machine HOST */ - if (send(sd, request.c_str(), request.length(), 0) == -1) { - perror("send"); - return false; - } - - /* wait for a message to come back from the server */ - if (recv(sd, buffer, BUFFER_SIZE, 0) == -1) { - perror("recv"); - return false; - } - - char* error = strstr(buffer, "404 Not Found\r\n"); - if (error) { - return false; - } - error = strstr(buffer, "400 Bad Request\r\n"); - if (error) { - return false; - } - - return true; +NetworkMeta::~NetworkMeta() { + curl_easy_cleanup(curl); } int NetworkMeta::check_login(std::string username, std::string password) { - char dir[BUFFER_SIZE]; - for (int i = 0; i < BUFFER_SIZE; i++) { - dir[i] = '\0'; - } - std::string request = "GET /game/game_login.php?user=" + username + "&password=" + password + " HTTP/1.1\r\nHost: " + hostname + "\r\n\r\n"; - if (!perform_request(request, dir)) { - return -1; - } - char* content = strstr(dir, "Content-Length: "); - if (content) { - // Apache 2.x + //FIXME: look at http://curl.haxx.se/lxr/source/docs/examples/getinmemory.c - // determine data length - content += strlen("Content-Length: "); - char* data_len_str = strstr(content, "\r\n"); - *data_len_str = '\0'; - int data_len = atoi(content); - *data_len_str = '\r'; + std::string request = "http://" + hostname + "/script/schnittstelle/?Action=login&user=" + username + "&password=" + password; - // determine data - char* data = strstr(content, "\r\n\r\n"); - data += strlen("\r\n\r\n"); - char* data2 = data + data_len; - *data2 = '\0'; - int result = atoi(data); - return result; + std::cout << request << std::endl; - } else { - // Apache 1.3x + curl_easy_setopt(curl, CURLOPT_URL, request.c_str()); + CURLcode res = curl_easy_perform(curl); - content = strstr(dir, "\r\n\r\n"); - - // determine data length - content += strlen("\r\n\r\n"); - char* data_len_str = strstr(content, "\r\n"); - *data_len_str = '\0'; - int data_len = atoi(content); - *data_len_str = '\r'; - - // determine data - data_len_str += strlen("\r\n"); - char* data = strstr(data_len_str, "\r\n"); - *data = '\0'; - int result = atoi(data_len_str); - return result; - } } bool NetworkMeta::verify_version() { Modified: src/server/network_meta.h =================================================================== --- src/server/network_meta.h 2006-09-02 09:12:15 UTC (rev 151) +++ src/server/network_meta.h 2006-10-23 21:55:52 UTC (rev 152) @@ -36,17 +36,20 @@ #include <netdb.h> #include <string.h> #include <string> +#include <curl/curl.h> #define BUFFER_SIZE 512 class NetworkMeta { public: NetworkMeta(); + ~NetworkMeta(); int check_login(std::string username, std::string password); bool verify_version(); private: std::string hostname; bool perform_request(std::string request, char* buffer); + CURL *curl; }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-09-02 09:12:25
|
Revision: 151 http://svn.sourceforge.net/opengate/?rev=151&view=rev Author: egore Date: 2006-09-02 02:12:15 -0700 (Sat, 02 Sep 2006) Log Message: ----------- add bogus versionchecking Modified Paths: -------------- ChangeLog src/server/network.cpp src/server/network.h src/server/network_meta.cpp src/server/network_meta.h Modified: ChangeLog =================================================================== --- ChangeLog 2006-09-01 23:05:50 UTC (rev 150) +++ ChangeLog 2006-09-02 09:12:15 UTC (rev 151) @@ -1,5 +1,11 @@ 2006-09-02 Christoph Brill <eg...@us...> + * src/server/network.h, src/server/network.cpp, + src/server/network_meta.h, src/server/network_meta.cpp: start method + for checking the servers version against the meta server + +2006-09-02 Christoph Brill <eg...@us...> + * src/server/network.h, src/server/network.cpp: handle client login and quit request @@ -10,7 +16,6 @@ src/opengate_client.cpp: send login to server and quit when client quits - 2006-08-30 Christoph Brill <eg...@us...> * src/server/network_meta.h, src/server/network_meta.cpp: add method Modified: src/server/network.cpp =================================================================== --- src/server/network.cpp 2006-09-01 23:05:50 UTC (rev 150) +++ src/server/network.cpp 2006-09-02 09:12:15 UTC (rev 151) @@ -22,10 +22,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - #include <iostream> #include <string> #include "network.h" @@ -42,6 +38,7 @@ grapple_server_maxusers_set(server, max_users); nwm = new NetworkMeta(); + done = !nwm->verify_version(); } Network::~Network() { Modified: src/server/network.h =================================================================== --- src/server/network.h 2006-09-01 23:05:50 UTC (rev 150) +++ src/server/network.h 2006-09-02 09:12:15 UTC (rev 151) @@ -25,6 +25,10 @@ #ifndef _OPENGATE_NETWORK_ #define _OPENGATE_NETWORK_ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <grapple.h> #include "network_meta.h" Modified: src/server/network_meta.cpp =================================================================== --- src/server/network_meta.cpp 2006-09-01 23:05:50 UTC (rev 150) +++ src/server/network_meta.cpp 2006-09-02 09:12:15 UTC (rev 151) @@ -26,19 +26,21 @@ #include <iostream> -int NetworkMeta::check_login(std::string username, std::string password) { - char dir[BUFFER_SIZE]; +NetworkMeta::NetworkMeta() { + hostname = "opengate.sourceforge.net"; +} + +bool NetworkMeta::perform_request(std::string request, char* buffer) { + int sd; struct sockaddr_in sin; struct sockaddr_in pin; struct hostent *hp; - std::string hostname = "opengate.sourceforge.net"; - /* go find out about the desired host machine */ if ((hp = gethostbyname(hostname.c_str())) == 0) { perror("gethostbyname"); - exit(1); + return false; } /* fill in the socket structure with host information */ @@ -50,38 +52,49 @@ /* grab an Internet domain socket */ if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { perror("socket"); - exit(1); + return false; } /* connect to PORT on HOST */ if (connect(sd,(struct sockaddr *) &pin, sizeof(pin)) == -1) { perror("connect"); - exit(1); + return false; } - std::string request = "GET /game/game_login.php?user=" + username + "&password=" + password + " HTTP/1.1\r\nHost: " + hostname + "\r\n\r\n"; - /* send a message to the server PORT on machine HOST */ if (send(sd, request.c_str(), request.length(), 0) == -1) { perror("send"); - exit(1); + return false; } /* wait for a message to come back from the server */ - if (recv(sd, dir, BUFFER_SIZE, 0) == -1) { + if (recv(sd, buffer, BUFFER_SIZE, 0) == -1) { perror("recv"); - exit(1); + return false; } - char* error = strstr(dir, "404 Not Found\r\n"); + char* error = strstr(buffer, "404 Not Found\r\n"); if (error) { - return -100; + return false; } - error = strstr(dir, "400 Bad Request\r\n"); + error = strstr(buffer, "400 Bad Request\r\n"); if (error) { - return -101; + return false; } + return true; +} + +int NetworkMeta::check_login(std::string username, std::string password) { + char dir[BUFFER_SIZE]; + for (int i = 0; i < BUFFER_SIZE; i++) { + dir[i] = '\0'; + } + std::string request = "GET /game/game_login.php?user=" + username + "&password=" + password + " HTTP/1.1\r\nHost: " + hostname + "\r\n\r\n"; + if (!perform_request(request, dir)) { + return -1; + } + char* content = strstr(dir, "Content-Length: "); if (content) { // Apache 2.x @@ -121,3 +134,8 @@ return result; } } + +bool NetworkMeta::verify_version() { + // TODO: ask the server! + return true; +} Modified: src/server/network_meta.h =================================================================== --- src/server/network_meta.h 2006-09-01 23:05:50 UTC (rev 150) +++ src/server/network_meta.h 2006-09-02 09:12:15 UTC (rev 151) @@ -41,8 +41,12 @@ class NetworkMeta { public: + NetworkMeta(); int check_login(std::string username, std::string password); - + bool verify_version(); +private: + std::string hostname; + bool perform_request(std::string request, char* buffer); }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-09-01 23:06:08
|
Revision: 150 http://svn.sourceforge.net/opengate/?rev=150&view=rev Author: egore Date: 2006-09-01 16:05:50 -0700 (Fri, 01 Sep 2006) Log Message: ----------- add authentication against meta server from client Modified Paths: -------------- ChangeLog src/client/network.cpp src/client/network.h src/common/Makefile.am src/opengate_client.cpp src/opengate_server.cpp src/server/network.cpp src/server/network.h src/server/network_meta.cpp Added Paths: ----------- src/common/network_protocol.h Modified: ChangeLog =================================================================== --- ChangeLog 2006-08-31 20:16:09 UTC (rev 149) +++ ChangeLog 2006-09-01 23:05:50 UTC (rev 150) @@ -1,5 +1,18 @@ -2006-08-27 Christoph Brill <eg...@us...> +2006-09-02 Christoph Brill <eg...@us...> + * src/server/network.h, src/server/network.cpp: handle + client login and quit request + + * src/common/network_protocol.h: add first codes for client and server + communication + + * src/client/network.h, src/client/network.cpp, + src/opengate_client.cpp: send login to server and quit when client + quits + + +2006-08-30 Christoph Brill <eg...@us...> + * src/server/network_meta.h, src/server/network_meta.cpp: add method to authenticate against the meta-server Modified: src/client/network.cpp =================================================================== --- src/client/network.cpp 2006-08-31 20:16:09 UTC (rev 149) +++ src/client/network.cpp 2006-09-01 23:05:50 UTC (rev 150) @@ -27,8 +27,11 @@ #endif #include "network.h" +#include "../common/network_protocol.h" #include <string.h> +#include <iostream> +#include <sstream> Network::Network() { client = grapple_client_init(PACKAGE_NAME, VERSION); @@ -44,7 +47,19 @@ grapple_client_destroy(client); } -void Network::send() { - char* data = "opengate_test_message"; - grapple_confirmid confirm = grapple_client_send(client, GRAPPLE_SERVER, GRAPPLE_RELIABLE, data, strlen(data)); +void Network::send(std::string data) { + grapple_confirmid confirm = grapple_client_send(client, GRAPPLE_SERVER, GRAPPLE_RELIABLE, (char *)data.c_str(), data.length()); } + +void Network::login(std::string username, std::string password) { + std::ostringstream o; + o << PROTO_LOGIN; + this->send(o.str() + ", " + username + ", " + password); + //TODO: grapple_client_name_set(client, username.c_str()); +} + +void Network::quit() { + std::ostringstream o; + o << PROTO_QUIT; + this->send(o.str()); +} Modified: src/client/network.h =================================================================== --- src/client/network.h 2006-08-31 20:16:09 UTC (rev 149) +++ src/client/network.h 2006-09-01 23:05:50 UTC (rev 150) @@ -26,14 +26,17 @@ #define _OPENGATE_NETWORK_ #include <grapple.h> +#include <string> class Network { private: grapple_client client; + void send(std::string data); public: Network(); ~Network(); - void send(); + void login(std::string username, std::string password); + void quit(); }; #endif Modified: src/common/Makefile.am =================================================================== --- src/common/Makefile.am 2006-08-31 20:16:09 UTC (rev 149) +++ src/common/Makefile.am 2006-09-01 23:05:50 UTC (rev 150) @@ -4,7 +4,7 @@ libopengate_common_la_SOURCES = loader.cpp exception.cpp company.cpp \ faction.cpp faction_storage.cpp company_storage.cpp gamestate.cpp noinst_HEADERS = loader.h exception.h company.h faction.h faction_storage.h \ - company_storage.h gamestate.h + company_storage.h gamestate.h network_protocol.h SUBDIRS = objects equipment components libopengate_common_la_LIBADD = \ $(top_builddir)/src/common/objects/libopengate-objects.la $(top_builddir)/src/common/equipment/libopengate-equipment.la \ Added: src/common/network_protocol.h =================================================================== --- src/common/network_protocol.h (rev 0) +++ src/common/network_protocol.h 2006-09-01 23:05:50 UTC (rev 150) @@ -0,0 +1,26 @@ +/*************************************************************************** + * network_protocoll.h + * + * Sat Sept 01 00:11:55 2006 + * Copyright 2006 Christoph Brill + * Email <eg...@us...> + ****************************************************************************/ + +/* + * 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 of the License, 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#define PROTO_LOGIN 01 +#define PROTO_QUIT 02 Property changes on: src/common/network_protocol.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native Modified: src/opengate_client.cpp =================================================================== --- src/opengate_client.cpp 2006-08-31 20:16:09 UTC (rev 149) +++ src/opengate_client.cpp 2006-09-01 23:05:50 UTC (rev 150) @@ -70,7 +70,7 @@ cout << "-----------" << std::endl; Network* nw = new Network(); - nw->send(); + nw->login("XXX", "YYY"); /* Loader* loader = new Loader(); loader->parse_file("money.xml"); @@ -152,6 +152,7 @@ delete(f_storage); delete(loader); + nw->quit(); delete(nw); cout << "-------------" << std::endl; Modified: src/opengate_server.cpp =================================================================== --- src/opengate_server.cpp 2006-08-31 20:16:09 UTC (rev 149) +++ src/opengate_server.cpp 2006-09-01 23:05:50 UTC (rev 150) @@ -28,9 +28,8 @@ #include <signal.h> #include "server/network.h" -#include "server/network_meta.h" -bool done; +Network* nw; /*! @brief a signal handler * @@ -40,30 +39,25 @@ */ void shutdown_server(int sig) { printf("Signal %d caught, starting shutdown.\n", sig); - done = true; + nw->set_done(); } int main(int argc, char *argv[]) { std::cout << "Statring up" << std::endl; std::cout << "-----------" << std::endl; - /*signal(SIGINT, shutdown_server); + signal(SIGINT, shutdown_server); - done = false; - Network* nw = new Network(2); - while (!done) { + nw = new Network(2); + while (!nw->is_done()) { nw->pull(); sleep(1); - }*/ + } - NetworkMeta* nwm = new NetworkMeta(); - printf("--(%d)--\n", nwm->check_login("XXX", "YYY")); - std::cout << "Shutting down" << std::endl; std::cout << "-------------" << std::endl; - //delete(nw); - delete(nwm); + delete(nw); return EXIT_SUCCESS; } Modified: src/server/network.cpp =================================================================== --- src/server/network.cpp 2006-08-31 20:16:09 UTC (rev 149) +++ src/server/network.cpp 2006-09-01 23:05:50 UTC (rev 150) @@ -27,27 +27,36 @@ #endif #include <iostream> - +#include <string> #include "network.h" +#include "../common/network_protocol.h" Network::Network(int max_users) { + done = false; + server = grapple_server_init(PACKAGE_NAME, VERSION); grapple_server_port_set(server, 1234); grapple_server_protocol_set(server, GRAPPLE_PROTOCOL_UDP); grapple_server_session_set(server, "Opengate Test Server"); grapple_server_start(server); grapple_server_maxusers_set(server, max_users); + + nwm = new NetworkMeta(); } Network::~Network() { //TODO: disconnect all clients grapple_server_stop(server); grapple_server_destroy(server); + delete(nwm); } void Network::pull() { std::cout << "pulling" << std::endl; grapple_message* message = 0; + char* data = 0; + int type = 0; + char* passwd = 0; if (grapple_server_messages_waiting(server)) { message = grapple_server_message_pull(server); switch (message->type) { @@ -62,6 +71,43 @@ case GRAPPLE_MSG_USER_MSG: std::cout << "message!" << std::endl; //Your code to handle this message + data = (char*)message->USER_MSG.data; + data += 2; + *data = '\0'; + data = (char*)message->USER_MSG.data; + type = atoi(data); + data += 2; + *data = ','; + + switch (type) { + case PROTO_LOGIN: + std::cout << "Login protocol message" << std::endl; + + // Null-terminate the string + data = (char*)message->USER_MSG.data; + data += message->USER_MSG.length; + *data = '\0'; + + // parse username an password from the string + data = (char*)message->USER_MSG.data + 3; + passwd = strstr(data, ", "); + *passwd = '\0'; + passwd += strlen(", "); + + printf("--(%d)--\n", nwm->check_login(data, passwd)); + + break; + + case PROTO_QUIT: + std::cout << "Quit protocol message" << std::endl; + done = true; + break; + + default: + std::cout << "Unkown protocol message: " << type << std::endl; + break; + } + break; case GRAPPLE_MSG_USER_DISCONNECTED: std::cout << "disconnected!" << std::endl; @@ -71,3 +117,11 @@ grapple_message_dispose(message); } } + +bool Network::is_done() { + return done; +} + +void Network::set_done() { + done = true; +} Modified: src/server/network.h =================================================================== --- src/server/network.h 2006-08-31 20:16:09 UTC (rev 149) +++ src/server/network.h 2006-09-01 23:05:50 UTC (rev 150) @@ -26,14 +26,19 @@ #define _OPENGATE_NETWORK_ #include <grapple.h> +#include "network_meta.h" class Network { private: grapple_server server; + NetworkMeta* nwm; + bool done; public: Network(int max_users); ~Network(); void pull(); + void set_done(); + bool is_done(); }; Modified: src/server/network_meta.cpp =================================================================== --- src/server/network_meta.cpp 2006-08-31 20:16:09 UTC (rev 149) +++ src/server/network_meta.cpp 2006-09-01 23:05:50 UTC (rev 150) @@ -59,7 +59,7 @@ exit(1); } - std::string request = "GET /game/game_login.php?username=" + username + "&password=" + password + " HTTP/1.1\r\nHost: " + hostname + "\r\n\r\n"; + std::string request = "GET /game/game_login.php?user=" + username + "&password=" + password + " HTTP/1.1\r\nHost: " + hostname + "\r\n\r\n"; /* send a message to the server PORT on machine HOST */ if (send(sd, request.c_str(), request.length(), 0) == -1) { @@ -116,10 +116,8 @@ // determine data data_len_str += strlen("\r\n"); char* data = strstr(data_len_str, "\r\n"); - data += strlen("\r\n"); - char* data2 = data + data_len; - *data2 = '\0'; - int result = atoi(data); + *data = '\0'; + int result = atoi(data_len_str); return result; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-08-31 20:16:23
|
Revision: 149 http://svn.sourceforge.net/opengate/?rev=149&view=rev Author: egore Date: 2006-08-31 13:16:09 -0700 (Thu, 31 Aug 2006) Log Message: ----------- add meta-server authentication Modified Paths: -------------- ChangeLog opengate.kdevelop src/opengate_server.cpp src/server/Makefile.am Added Paths: ----------- src/server/network_meta.cpp src/server/network_meta.h Modified: ChangeLog =================================================================== --- ChangeLog 2006-08-27 18:19:29 UTC (rev 148) +++ ChangeLog 2006-08-31 20:16:09 UTC (rev 149) @@ -1,5 +1,12 @@ 2006-08-27 Christoph Brill <eg...@us...> + * src/server/network_meta.h, src/server/network_meta.cpp: add method + to authenticate against the meta-server + + * src/opengate_server.cpp: test method for authentication + +2006-08-27 Christoph Brill <eg...@us...> + * configure.in: add support for libgrapple, add support for libxml2 * src/client/network.h, src/client/network.cpp, src/server/network.h, Modified: opengate.kdevelop =================================================================== --- opengate.kdevelop 2006-08-27 18:19:29 UTC (rev 148) +++ opengate.kdevelop 2006-08-31 20:16:09 UTC (rev 149) @@ -13,7 +13,7 @@ <ignoreparts/> <projectdirectory>.</projectdirectory> <absoluteprojectpath>false</absoluteprojectpath> - <description/> + <description></description> <versioncontrol>kdevsubversion</versioncontrol> </general> <kdevautoproject> @@ -23,7 +23,7 @@ <useactivetarget>true</useactivetarget> </general> <run> - <mainprogram>src/opengate-client</mainprogram> + <mainprogram>src/opengate-server</mainprogram> <terminal>true</terminal> <directoryradio>executable</directoryradio> <runarguments> @@ -32,7 +32,7 @@ <opengate-client/> </runarguments> <customdirectory>/</customdirectory> - <programargs/> + <programargs></programargs> <autocompile>true</autocompile> <envvars/> </run> @@ -224,12 +224,12 @@ </kdevcppsupport> <kdevdebugger> <general> - <programargs/> - <gdbpath/> + <programargs></programargs> + <gdbpath></gdbpath> <dbgshell>libtool</dbgshell> - <configGdbScript/> - <runShellScript/> - <runGdbScript/> + <configGdbScript></configGdbScript> + <runShellScript></runShellScript> + <runGdbScript></runGdbScript> <breakonloadinglibs>true</breakonloadinglibs> <separatetty>false</separatetty> <floatingtoolbar>false</floatingtoolbar> Modified: src/opengate_server.cpp =================================================================== --- src/opengate_server.cpp 2006-08-27 18:19:29 UTC (rev 148) +++ src/opengate_server.cpp 2006-08-31 20:16:09 UTC (rev 149) @@ -28,17 +28,8 @@ #include <signal.h> #include "server/network.h" +#include "server/network_meta.h" - -#include <stdio.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <netdb.h> -#include <string.h> - -#define DIRSIZE 1024 - bool done; /*! @brief a signal handler @@ -65,57 +56,14 @@ sleep(1); }*/ - char dir[DIRSIZE]; - int sd; - struct sockaddr_in sin; - struct sockaddr_in pin; - struct hostent *hp; + NetworkMeta* nwm = new NetworkMeta(); + printf("--(%d)--\n", nwm->check_login("XXX", "YYY")); - /* go find out about the desired host machine */ - if ((hp = gethostbyname("opengate.sourceforge.net")) == 0) { - perror("gethostbyname"); - exit(1); - } - - /* fill in the socket structure with host information */ - memset(&pin, 0, sizeof(pin)); - pin.sin_family = AF_INET; - pin.sin_addr.s_addr = ((struct in_addr *)(hp->h_addr))->s_addr; - pin.sin_port = htons(80); - - /* grab an Internet domain socket */ - if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { - perror("socket"); - exit(1); - } - - /* connect to PORT on HOST */ - if (connect(sd,(struct sockaddr *) &pin, sizeof(pin)) == -1) { - perror("connect"); - exit(1); - } - - char* request = "GET /game/game_login.php HTTP/1.1\r\nHost: opengate.sourceforge.net\r\n\r\n"; - - /* send a message to the server PORT on machine HOST */ - if (send(sd, request, strlen(request), 0) == -1) { - perror("send"); - exit(1); - } - - /* wait for a message to come back from the server */ - if (recv(sd, dir, DIRSIZE, 0) == -1) { - perror("recv"); - exit(1); - } - - // spew-out the results and bail out of here! - printf("%s\n---\n", dir); - std::cout << "Shutting down" << std::endl; std::cout << "-------------" << std::endl; //delete(nw); + delete(nwm); return EXIT_SUCCESS; } Modified: src/server/Makefile.am =================================================================== --- src/server/Makefile.am 2006-08-27 18:19:29 UTC (rev 148) +++ src/server/Makefile.am 2006-08-31 20:16:09 UTC (rev 149) @@ -1,5 +1,5 @@ INCLUDES = $(all_includes) METASOURCES = AUTO noinst_LTLIBRARIES = libopengate-server.la -noinst_HEADERS = network.h -libopengate_server_la_SOURCES = network.cpp +noinst_HEADERS = network.h network_meta.h +libopengate_server_la_SOURCES = network.cpp network_meta.cpp Added: src/server/network_meta.cpp =================================================================== --- src/server/network_meta.cpp (rev 0) +++ src/server/network_meta.cpp 2006-08-31 20:16:09 UTC (rev 149) @@ -0,0 +1,125 @@ +/*************************************************************************** + * network_meta.h + * + * Sat Aug 31 21:04:10 2006 + * Copyright 2006 Christoph Brill + * Email <eg...@us...> + ****************************************************************************/ + +/* + * 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 of the License, 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <network_meta.h> + +#include <iostream> + +int NetworkMeta::check_login(std::string username, std::string password) { + char dir[BUFFER_SIZE]; + int sd; + struct sockaddr_in sin; + struct sockaddr_in pin; + struct hostent *hp; + + std::string hostname = "opengate.sourceforge.net"; + + /* go find out about the desired host machine */ + if ((hp = gethostbyname(hostname.c_str())) == 0) { + perror("gethostbyname"); + exit(1); + } + + /* fill in the socket structure with host information */ + memset(&pin, 0, sizeof(pin)); + pin.sin_family = AF_INET; + pin.sin_addr.s_addr = ((struct in_addr *)(hp->h_addr))->s_addr; + pin.sin_port = htons(80); + + /* grab an Internet domain socket */ + if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { + perror("socket"); + exit(1); + } + + /* connect to PORT on HOST */ + if (connect(sd,(struct sockaddr *) &pin, sizeof(pin)) == -1) { + perror("connect"); + exit(1); + } + + std::string request = "GET /game/game_login.php?username=" + username + "&password=" + password + " HTTP/1.1\r\nHost: " + hostname + "\r\n\r\n"; + + /* send a message to the server PORT on machine HOST */ + if (send(sd, request.c_str(), request.length(), 0) == -1) { + perror("send"); + exit(1); + } + + /* wait for a message to come back from the server */ + if (recv(sd, dir, BUFFER_SIZE, 0) == -1) { + perror("recv"); + exit(1); + } + + char* error = strstr(dir, "404 Not Found\r\n"); + if (error) { + return -100; + } + error = strstr(dir, "400 Bad Request\r\n"); + if (error) { + return -101; + } + + char* content = strstr(dir, "Content-Length: "); + if (content) { + // Apache 2.x + + // determine data length + content += strlen("Content-Length: "); + char* data_len_str = strstr(content, "\r\n"); + *data_len_str = '\0'; + int data_len = atoi(content); + *data_len_str = '\r'; + + // determine data + char* data = strstr(content, "\r\n\r\n"); + data += strlen("\r\n\r\n"); + char* data2 = data + data_len; + *data2 = '\0'; + int result = atoi(data); + return result; + + } else { + // Apache 1.3x + + content = strstr(dir, "\r\n\r\n"); + + // determine data length + content += strlen("\r\n\r\n"); + char* data_len_str = strstr(content, "\r\n"); + *data_len_str = '\0'; + int data_len = atoi(content); + *data_len_str = '\r'; + + // determine data + data_len_str += strlen("\r\n"); + char* data = strstr(data_len_str, "\r\n"); + data += strlen("\r\n"); + char* data2 = data + data_len; + *data2 = '\0'; + int result = atoi(data); + return result; + } +} Property changes on: src/server/network_meta.cpp ___________________________________________________________________ Name: svn:mime-type + text/x-c++src Name: svn:eol-style + native Added: src/server/network_meta.h =================================================================== --- src/server/network_meta.h (rev 0) +++ src/server/network_meta.h 2006-08-31 20:16:09 UTC (rev 149) @@ -0,0 +1,48 @@ +/*************************************************************************** + * network_meta.h + * + * Sat Aug 31 21:04:10 2006 + * Copyright 2006 Christoph Brill + * Email <eg...@us...> + ****************************************************************************/ + +/* + * 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 of the License, 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _OPENGATE_NETWORK_META_ +#define _OPENGATE_NETWORK_META_ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdio.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <netdb.h> +#include <string.h> +#include <string> + +#define BUFFER_SIZE 512 + +class NetworkMeta { +public: + int check_login(std::string username, std::string password); + +}; + +#endif Property changes on: src/server/network_meta.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-08-27 18:19:40
|
Revision: 148 Author: egore Date: 2006-08-27 11:19:29 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=148&view=rev Log Message: ----------- fix libxml2 start connection to metaserver Modified Paths: -------------- ChangeLog configure.in opengate.kdevelop src/opengate_server.cpp Modified: ChangeLog =================================================================== --- ChangeLog 2006-08-27 12:53:34 UTC (rev 147) +++ ChangeLog 2006-08-27 18:19:29 UTC (rev 148) @@ -10,6 +10,10 @@ * src/opengate-client.cpp: connect to the server and send a message + * configure.in: fix libxml2 support + + * src/opengate-server.cpp: start work on connection to metaserver + 2006-07-30 Christoph Brill <eg...@us...> * src/client/input: drop old handmade inputsystem Modified: configure.in =================================================================== --- configure.in 2006-08-27 12:53:34 UTC (rev 147) +++ configure.in 2006-08-27 18:19:29 UTC (rev 148) @@ -32,7 +32,7 @@ AM_LDFLAGS="$AM_LDFLAGS $GRAPPLE_LIBS" #libxml2 - http://www.xmlsoft.org/ -PKG_CHECK_MODULES(LIBXML2, [libxml2 >= 2.6]) +PKG_CHECK_MODULES(LIBXML2, [libxml-2.0 >= 2.6]) AM_CXXFLAGS="$AM_CXXFLAGS $LIBXML2_CFLAGS" AM_LDFLAGS="$AM_LDFLAGS $LIBXML2_LIBS" Modified: opengate.kdevelop =================================================================== --- opengate.kdevelop 2006-08-27 12:53:34 UTC (rev 147) +++ opengate.kdevelop 2006-08-27 18:19:29 UTC (rev 148) @@ -13,7 +13,7 @@ <ignoreparts/> <projectdirectory>.</projectdirectory> <absoluteprojectpath>false</absoluteprojectpath> - <description></description> + <description/> <versioncontrol>kdevsubversion</versioncontrol> </general> <kdevautoproject> @@ -32,7 +32,7 @@ <opengate-client/> </runarguments> <customdirectory>/</customdirectory> - <programargs></programargs> + <programargs/> <autocompile>true</autocompile> <envvars/> </run> @@ -62,14 +62,14 @@ <f77compiler>kdevg77options</f77compiler> <cxxflags>-O0 -g3</cxxflags> <envvars/> - <topsourcedir></topsourcedir> - <cppflags></cppflags> - <ldflags></ldflags> - <ccompilerbinary></ccompilerbinary> - <cxxcompilerbinary></cxxcompilerbinary> - <f77compilerbinary></f77compilerbinary> - <cflags></cflags> - <f77flags></f77flags> + <topsourcedir/> + <cppflags/> + <ldflags/> + <ccompilerbinary/> + <cxxcompilerbinary/> + <f77compilerbinary/> + <cflags/> + <f77flags/> </debug> <default> <envvars/> @@ -224,12 +224,12 @@ </kdevcppsupport> <kdevdebugger> <general> - <programargs></programargs> - <gdbpath></gdbpath> + <programargs/> + <gdbpath/> <dbgshell>libtool</dbgshell> - <configGdbScript></configGdbScript> - <runShellScript></runShellScript> - <runGdbScript></runGdbScript> + <configGdbScript/> + <runShellScript/> + <runGdbScript/> <breakonloadinglibs>true</breakonloadinglibs> <separatetty>false</separatetty> <floatingtoolbar>false</floatingtoolbar> Modified: src/opengate_server.cpp =================================================================== --- src/opengate_server.cpp 2006-08-27 12:53:34 UTC (rev 147) +++ src/opengate_server.cpp 2006-08-27 18:19:29 UTC (rev 148) @@ -29,6 +29,16 @@ #include "server/network.h" + +#include <stdio.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <netdb.h> +#include <string.h> + +#define DIRSIZE 1024 + bool done; /*! @brief a signal handler @@ -46,19 +56,66 @@ std::cout << "Statring up" << std::endl; std::cout << "-----------" << std::endl; - signal(SIGINT, shutdown_server); + /*signal(SIGINT, shutdown_server); done = false; Network* nw = new Network(2); while (!done) { nw->pull(); sleep(1); + }*/ + + char dir[DIRSIZE]; + int sd; + struct sockaddr_in sin; + struct sockaddr_in pin; + struct hostent *hp; + + /* go find out about the desired host machine */ + if ((hp = gethostbyname("opengate.sourceforge.net")) == 0) { + perror("gethostbyname"); + exit(1); } + /* fill in the socket structure with host information */ + memset(&pin, 0, sizeof(pin)); + pin.sin_family = AF_INET; + pin.sin_addr.s_addr = ((struct in_addr *)(hp->h_addr))->s_addr; + pin.sin_port = htons(80); + + /* grab an Internet domain socket */ + if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { + perror("socket"); + exit(1); + } + + /* connect to PORT on HOST */ + if (connect(sd,(struct sockaddr *) &pin, sizeof(pin)) == -1) { + perror("connect"); + exit(1); + } + + char* request = "GET /game/game_login.php HTTP/1.1\r\nHost: opengate.sourceforge.net\r\n\r\n"; + + /* send a message to the server PORT on machine HOST */ + if (send(sd, request, strlen(request), 0) == -1) { + perror("send"); + exit(1); + } + + /* wait for a message to come back from the server */ + if (recv(sd, dir, DIRSIZE, 0) == -1) { + perror("recv"); + exit(1); + } + + // spew-out the results and bail out of here! + printf("%s\n---\n", dir); + std::cout << "Shutting down" << std::endl; std::cout << "-------------" << std::endl; - delete(nw); + //delete(nw); return EXIT_SUCCESS; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-08-27 12:53:54
|
Revision: 147 Author: egore Date: 2006-08-27 05:53:34 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=147&view=rev Log Message: ----------- update config-files make use of pkgconfig in more places play around with controls and destroy them on the way (will be fixed soon) add networking Modified Paths: -------------- ChangeLog config.guess config.sub configure.in opengate.kdevelop src/client/network.cpp src/client/network.h src/client/ui/ActionConfig.cpp src/client/ui/avatar.h src/opengate_client.cpp src/opengate_server.cpp src/server/network.cpp src/server/network.h Modified: ChangeLog =================================================================== --- ChangeLog 2006-08-05 22:06:37 UTC (rev 146) +++ ChangeLog 2006-08-27 12:53:34 UTC (rev 147) @@ -1,3 +1,15 @@ +2006-08-27 Christoph Brill <eg...@us...> + + * configure.in: add support for libgrapple, add support for libxml2 + + * src/client/network.h, src/client/network.cpp, src/server/network.h, + src/server/network.cpp: drop SDL_net in favour of libgrapple + + * src/opengate-server.cpp: add polling server (1s interval for test + purposes) + + * src/opengate-client.cpp: connect to the server and send a message + 2006-07-30 Christoph Brill <eg...@us...> * src/client/input: drop old handmade inputsystem Modified: config.guess =================================================================== --- config.guess 2006-08-05 22:06:37 UTC (rev 146) +++ config.guess 2006-08-27 12:53:34 UTC (rev 147) @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2006-02-27' +timestamp='2006-07-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -228,7 +228,7 @@ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} @@ -788,6 +788,8 @@ case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac @@ -798,9 +800,6 @@ i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS_NT-*:*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 @@ -808,10 +807,10 @@ i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - x86:Interix*:[345]*) + x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T:Interix*:[345]*) + EM64T:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) @@ -849,6 +848,9 @@ arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; cris:Linux:*:*) echo cris-axis-linux-${LIBC} exit ;; @@ -951,7 +953,7 @@ echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1009,7 +1011,7 @@ LIBC=gnulibc1 # endif #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun) + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout Modified: config.sub =================================================================== --- config.sub 2006-08-05 22:06:37 UTC (rev 146) +++ config.sub 2006-08-27 12:53:34 UTC (rev 147) @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2006-02-27' +timestamp='2006-07-02' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -241,7 +241,7 @@ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx | dvp \ @@ -249,7 +249,8 @@ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -275,11 +276,11 @@ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | shbe | sheb | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | strongarm \ + | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ @@ -287,9 +288,6 @@ | z8k) basic_machine=$basic_machine-unknown ;; - m32c) - basic_machine=$basic_machine-unknown - ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown @@ -319,7 +317,7 @@ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ + | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ @@ -330,7 +328,7 @@ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | m32r-* | m32rle-* \ + | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ @@ -359,7 +357,7 @@ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | shbe-* | sheb-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ @@ -374,8 +372,6 @@ | ymp-* \ | z8k-*) ;; - m32c-*) - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) @@ -1236,7 +1232,7 @@ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -irx*) + | -skyos* | -haiku* | -rdos* | -toppers* | -irx*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1388,6 +1384,9 @@ # system, and we'll never get to this point. case $basic_machine in + spu-*) + os=-elf + ;; *-acorn) os=-riscix1.2 ;; @@ -1397,9 +1396,9 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; + c4x-* | tic4x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 Modified: configure.in =================================================================== --- configure.in 2006-08-05 22:06:37 UTC (rev 146) +++ configure.in 2006-08-27 12:53:34 UTC (rev 147) @@ -26,6 +26,17 @@ AM_CXXFLAGS="$AM_CXXFLAGS $OIS_CFLAGS" AM_LDFLAGS="$AM_LDFLAGS $OIS_LIBS" +#libgrapple - http://grapple.linuxgamepublishing.com/grapple.php +PKG_CHECK_MODULES(GRAPPLE, [grapple >= 0.9]) +AM_CXXFLAGS="$AM_CXXFLAGS $GRAPPLE_CFLAGS" +AM_LDFLAGS="$AM_LDFLAGS $GRAPPLE_LIBS" + +#libxml2 - http://www.xmlsoft.org/ +PKG_CHECK_MODULES(LIBXML2, [libxml2 >= 2.6]) +AM_CXXFLAGS="$AM_CXXFLAGS $LIBXML2_CFLAGS" +AM_LDFLAGS="$AM_LDFLAGS $LIBXML2_LIBS" + + AC_SUBST(AM_CXXFLAGS, "$AM_CXXFLAGS") AC_SUBST(AM_LDFLAGS, "$AM_LDFLAGS") Modified: opengate.kdevelop =================================================================== --- opengate.kdevelop 2006-08-05 22:06:37 UTC (rev 146) +++ opengate.kdevelop 2006-08-27 12:53:34 UTC (rev 147) @@ -13,7 +13,7 @@ <ignoreparts/> <projectdirectory>.</projectdirectory> <absoluteprojectpath>false</absoluteprojectpath> - <description/> + <description></description> <versioncontrol>kdevsubversion</versioncontrol> </general> <kdevautoproject> @@ -32,7 +32,7 @@ <opengate-client/> </runarguments> <customdirectory>/</customdirectory> - <programargs/> + <programargs></programargs> <autocompile>true</autocompile> <envvars/> </run> @@ -62,14 +62,14 @@ <f77compiler>kdevg77options</f77compiler> <cxxflags>-O0 -g3</cxxflags> <envvars/> - <topsourcedir/> - <cppflags>`xml2-config --cflags` `sdl-config --cflags`</cppflags> - <ldflags>`xml2-config --libs` `sdl-config --libs` -lSDL_net</ldflags> - <ccompilerbinary/> - <cxxcompilerbinary/> - <f77compilerbinary/> - <cflags/> - <f77flags/> + <topsourcedir></topsourcedir> + <cppflags></cppflags> + <ldflags></ldflags> + <ccompilerbinary></ccompilerbinary> + <cxxcompilerbinary></cxxcompilerbinary> + <f77compilerbinary></f77compilerbinary> + <cflags></cflags> + <f77flags></f77flags> </debug> <default> <envvars/> @@ -224,12 +224,12 @@ </kdevcppsupport> <kdevdebugger> <general> - <programargs/> - <gdbpath/> + <programargs></programargs> + <gdbpath></gdbpath> <dbgshell>libtool</dbgshell> - <configGdbScript/> - <runShellScript/> - <runGdbScript/> + <configGdbScript></configGdbScript> + <runShellScript></runShellScript> + <runGdbScript></runGdbScript> <breakonloadinglibs>true</breakonloadinglibs> <separatetty>false</separatetty> <floatingtoolbar>false</floatingtoolbar> Modified: src/client/network.cpp =================================================================== --- src/client/network.cpp 2006-08-05 22:06:37 UTC (rev 146) +++ src/client/network.cpp 2006-08-27 12:53:34 UTC (rev 147) @@ -22,38 +22,29 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include "network.h" -#include "../common/exception.h" -#include <SDL/SDL.h> -#include <iostream> +#include <string.h> + Network::Network() { - if (SDLNet_Init () < 0) { - printf ("ERR Net: %s\n", SDLNet_GetError ()); - exit (-1); - } - client_udp_port = 37601; + client = grapple_client_init(PACKAGE_NAME, VERSION); + grapple_client_address_set(client, "localhost"); + grapple_client_port_set(client, 1234); + grapple_client_protocol_set(client, GRAPPLE_PROTOCOL_UDP); + grapple_client_start(client, 0); + //TODO:grapple_client_name_set(client, name); } -void Network::open_connection(char* hostname, Uint16 port) { - if (SDLNet_ResolveHost (server_ip, hostname, port) < 0) { - printf ("SDLNet_ResolveHost: %s\n", SDLNet_GetError ()); - SDLNet_Quit(); - exit (-1); - } - client = SDLNet_TCP_Open (server_ip); - if (client == NULL) { - printf ("ERR TCP_Open: %s\n", SDLNet_GetError ()); - SDLNet_Quit (); - exit (-1); - } - client_udp = SDLNet_UDP_Open (client_udp_port); - if (client_udp == NULL) { - printf ("ERR UDP_Open: %s\n", SDLNet_GetError ()); - SDLNet_Quit (); - exit (-1); - } +Network::~Network() { + grapple_client_stop(client); + grapple_client_destroy(client); } -Network::~Network() { +void Network::send() { + char* data = "opengate_test_message"; + grapple_confirmid confirm = grapple_client_send(client, GRAPPLE_SERVER, GRAPPLE_RELIABLE, data, strlen(data)); } Modified: src/client/network.h =================================================================== --- src/client/network.h 2006-08-05 22:06:37 UTC (rev 146) +++ src/client/network.h 2006-08-27 12:53:34 UTC (rev 147) @@ -25,19 +25,15 @@ #ifndef _OPENGATE_NETWORK_ #define _OPENGATE_NETWORK_ -#include <SDL/SDL_net.h> +#include <grapple.h> class Network { +private: + grapple_client client; public: Network(); ~Network(); - void open_connection(char* hostname, Uint16 port); -private: - IPaddress* server_ip; - TCPsocket client; - UDPsocket client_udp; - Uint16 client_udp_port; - + void send(); }; #endif Modified: src/client/ui/ActionConfig.cpp =================================================================== --- src/client/ui/ActionConfig.cpp 2006-08-05 22:06:37 UTC (rev 146) +++ src/client/ui/ActionConfig.cpp 2006-08-27 12:53:34 UTC (rev 147) @@ -562,12 +562,10 @@ mRotYScale = 0.0f; } -//--------------------------------------------------------------------------------// -bool ActionConfig::frameStarted(const Ogre::FrameEvent& evt) -{ +bool ActionConfig::frameStarted(const Ogre::FrameEvent& evt) { if (mChar) { - //FIXME:mChar->update (evt.timeSinceLastFrame, mInputDevice); + mChar->update (evt.timeSinceLastFrame, mRotXScale, mRotYScale, 0, mTranslateVector); if (mExCamera) { switch (mMode) { @@ -590,14 +588,14 @@ } } - Ogre::Camera *cam = mSceneMgr->getCamera("PlayerCam"); // Move about 100 units per second, mMoveScale = 100 * evt.timeSinceLastFrame; - cam->yaw(Ogre::Degree(mRotXScale)); - cam->pitch(Ogre::Degree(mRotYScale)); - cam->moveRelative(mTranslateVector); + //Ogre::Camera *cam = mSceneMgr->getCamera("PlayerCam"); + //cam->yaw(Ogre::Degree(mRotXScale)); + //cam->pitch(Ogre::Degree(mRotYScale)); + //cam->moveRelative(mTranslateVector); return true; } @@ -750,10 +748,14 @@ if( axis->absOnly == false ) { //Move using relative Axis - Ogre::Camera *cam = mSceneMgr->getCamera("PlayerCam"); + //Ogre::Camera *cam = mSceneMgr->getCamera("PlayerCam"); - cam->yaw(Ogre::Radian(Ogre::Degree(-axis->relX * 0.13f))); - cam->pitch(Ogre::Radian(Ogre::Degree(-axis->relY * 0.13f))); + /*if (mChar) { + mChar->update (evt.timeSinceLastFrame, mRotXScale, mRotYScale, 0, mTranslateVector); + }*/ + + //cam->yaw(Ogre::Radian(Ogre::Degree(-axis->relX * 0.13f))); + //cam->pitch(Ogre::Radian(Ogre::Degree(-axis->relY * 0.13f))); } else { Modified: src/client/ui/avatar.h =================================================================== --- src/client/ui/avatar.h 2006-08-05 22:06:37 UTC (rev 146) +++ src/client/ui/avatar.h 2006-08-27 12:53:34 UTC (rev 147) @@ -40,7 +40,7 @@ protected: public: // Updates the character (movement...) - virtual void update (Ogre::Real elapsedTime, Ogre::InputReader *input) = 0; + virtual void update (Ogre::Real elapsedTime, float rotXScale, float rotYScale, float rotZScale, Ogre::Vector3 translateVector) = 0; // The three methods below returns the two camera-related nodes, // and the current position of the character (for the 1st person camera) Ogre::SceneNode *getSightNode () { @@ -84,10 +84,14 @@ mSceneMgr->destroySceneNode (mName); } - void update (Ogre::Real elapsedTime, Ogre::InputReader *input) { - // Handle movement - if (input->isKeyDown (Ogre::KC_W)) { - mMainNode->translate (mMainNode->getOrientation () * Ogre::Vector3 (0, 0, 100 * elapsedTime)); + void update (Ogre::Real elapsedTime, float rotXScale, float rotYScale, float rotZScale, Ogre::Vector3 translateVector) { + + mMainNode->yaw(Ogre::Degree(rotXScale)); + mMainNode->pitch(Ogre::Degree(rotYScale)); + mMainNode->roll(Ogre::Degree(rotZScale)); + mMainNode->translate(mMainNode->getOrientation () * translateVector); + + /*mMainNode->translate (mMainNode->getOrientation () * Ogre::Vector3 (0, 0, 100 * elapsedTime)); } if (input->isKeyDown (Ogre::KC_S)) { mMainNode->translate (mMainNode->getOrientation () * Ogre::Vector3 (0, 0, -50 * elapsedTime)); @@ -97,7 +101,7 @@ } if (input->isKeyDown (Ogre::KC_D)) { mMainNode->yaw (Ogre::Radian (-2 * elapsedTime)); - } + }*/ } // Change visibility - Useful for 1st person view ;) Modified: src/opengate_client.cpp =================================================================== --- src/opengate_client.cpp 2006-08-05 22:06:37 UTC (rev 146) +++ src/opengate_client.cpp 2006-08-27 12:53:34 UTC (rev 147) @@ -39,6 +39,8 @@ #include "client/ui/application.h" #include "common/equipment/capacitor.h" +#include "client/network.h" + #include <OISException.h> using namespace std; @@ -66,6 +68,10 @@ cout << "-----------" << std::endl; cout << "Statring up" << std::endl; cout << "-----------" << std::endl; + + Network* nw = new Network(); + nw->send(); + /* Loader* loader = new Loader(); loader->parse_file("money.xml"); cout << loader->get_option("/equipment/name") << std::endl; @@ -146,6 +152,7 @@ delete(f_storage); delete(loader); + delete(nw); cout << "-------------" << std::endl; cout << "Shutting down" << std::endl; Modified: src/opengate_server.cpp =================================================================== --- src/opengate_server.cpp 2006-08-05 22:06:37 UTC (rev 146) +++ src/opengate_server.cpp 2006-08-27 12:53:34 UTC (rev 147) @@ -25,14 +25,40 @@ #include <iostream> #include <cstdlib> +#include <signal.h> -using namespace std; +#include "server/network.h" +bool done; + +/*! @brief a signal handler + * + * This method catches the SIGINT for the server to perform clean shutdown. + * + * @param sig the signal's number (see "man 7 signal") + */ +void shutdown_server(int sig) { + printf("Signal %d caught, starting shutdown.\n", sig); + done = true; +} + int main(int argc, char *argv[]) { - cout << "Statring up" << std::endl; - cout << "-----------" << std::endl; + std::cout << "Statring up" << std::endl; + std::cout << "-----------" << std::endl; - cout << "Shutting down" << std::endl; - cout << "-------------" << std::endl; + signal(SIGINT, shutdown_server); + + done = false; + Network* nw = new Network(2); + while (!done) { + nw->pull(); + sleep(1); + } + + std::cout << "Shutting down" << std::endl; + std::cout << "-------------" << std::endl; + + delete(nw); + return EXIT_SUCCESS; } Modified: src/server/network.cpp =================================================================== --- src/server/network.cpp 2006-08-05 22:06:37 UTC (rev 146) +++ src/server/network.cpp 2006-08-27 12:53:34 UTC (rev 147) @@ -22,39 +22,52 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "network.h" -#include "../common/exception.h" -#include <SDL/SDL.h> +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <iostream> -Network::Network() { - if (SDLNet_Init () < 0) { - printf ("ERR Net: %s\n", SDLNet_GetError ()); - exit (-1); - } - server_udp_port = 37605; - server_tcp_port = 37701; -} +#include "network.h" -void Network::open_connection() { - if (SDLNet_ResolveHost (server_ip, NULL, server_tcp_port) < 0) { - printf ("SDLNet_ResolveHost: %s\n", SDLNet_GetError ()); - SDLNet_Quit(); - exit (-1); - } - server = SDLNet_TCP_Open (server_ip); - if (server == NULL) { - printf ("ERR TCP_Open: %s\n", SDLNet_GetError ()); - SDLNet_Quit (); - exit (-1); - } - server_udp = SDLNet_UDP_Open (server_udp_port); - if (server_udp == NULL) { - printf ("ERR UDP_Open: %s\n", SDLNet_GetError ()); - SDLNet_Quit (); - exit (-1); - } +Network::Network(int max_users) { + server = grapple_server_init(PACKAGE_NAME, VERSION); + grapple_server_port_set(server, 1234); + grapple_server_protocol_set(server, GRAPPLE_PROTOCOL_UDP); + grapple_server_session_set(server, "Opengate Test Server"); + grapple_server_start(server); + grapple_server_maxusers_set(server, max_users); } Network::~Network() { + //TODO: disconnect all clients + grapple_server_stop(server); + grapple_server_destroy(server); } + +void Network::pull() { + std::cout << "pulling" << std::endl; + grapple_message* message = 0; + if (grapple_server_messages_waiting(server)) { + message = grapple_server_message_pull(server); + switch (message->type) { + case GRAPPLE_MSG_NEW_USER: + std::cout << "new user!" << std::endl; + //Your code to handle this message + break; + case GRAPPLE_MSG_USER_NAME: + std::cout << "username!" << std::endl; + //Your code to handle this message + break; + case GRAPPLE_MSG_USER_MSG: + std::cout << "message!" << std::endl; + //Your code to handle this message + break; + case GRAPPLE_MSG_USER_DISCONNECTED: + std::cout << "disconnected!" << std::endl; + //Your code to handle this message + break; + } + grapple_message_dispose(message); + } +} Modified: src/server/network.h =================================================================== --- src/server/network.h 2006-08-05 22:06:37 UTC (rev 146) +++ src/server/network.h 2006-08-27 12:53:34 UTC (rev 147) @@ -25,19 +25,15 @@ #ifndef _OPENGATE_NETWORK_ #define _OPENGATE_NETWORK_ -#include <SDL/SDL_net.h> +#include <grapple.h> class Network { +private: + grapple_server server; public: - Network(); + Network(int max_users); ~Network(); - void open_connection(); -private: - IPaddress* server_ip; - TCPsocket server; - UDPsocket server_udp; - Uint16 server_udp_port; - Uint16 server_tcp_port; + void pull(); }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-08-05 22:06:58
|
Revision: 146 Author: egore Date: 2006-08-05 15:06:37 -0700 (Sat, 05 Aug 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=146&view=rev Log Message: ----------- add forum add registration mail Modified Paths: -------------- website/game/database.php website/game/game_login.php website/game/include/connect.php.inc website/game/include/forum_add.php.inc website/game/include/forum_browse.php.inc website/game/include/login_check.php.inc website/game/index.php website/game/login.php website/game/register.php Added Paths: ----------- website/game/activate.php website/game/logout.php website/game/terms.php Added: website/game/activate.php =================================================================== (Binary files differ) Property changes on: website/game/activate.php ___________________________________________________________________ Name: svn:mime-type + application/x-httpd-php Modified: website/game/database.php =================================================================== (Binary files differ) Modified: website/game/game_login.php =================================================================== (Binary files differ) Modified: website/game/include/connect.php.inc =================================================================== (Binary files differ) Modified: website/game/include/forum_add.php.inc =================================================================== (Binary files differ) Modified: website/game/include/forum_browse.php.inc =================================================================== (Binary files differ) Modified: website/game/include/login_check.php.inc =================================================================== (Binary files differ) Modified: website/game/index.php =================================================================== (Binary files differ) Modified: website/game/login.php =================================================================== (Binary files differ) Added: website/game/logout.php =================================================================== (Binary files differ) Property changes on: website/game/logout.php ___________________________________________________________________ Name: svn:mime-type + application/x-httpd-php Modified: website/game/register.php =================================================================== (Binary files differ) Added: website/game/terms.php =================================================================== (Binary files differ) Property changes on: website/game/terms.php ___________________________________________________________________ Name: svn:mime-type + application/x-httpd-php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-07-31 20:35:10
|
Revision: 145 Author: egore Date: 2006-07-31 13:34:53 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=145&view=rev Log Message: ----------- start better documentation and customization of the code Modified Paths: -------------- data/Ships/Octavius/Apteryx/octavius_apteryx.mesh opengate.kdevelop src/client/ui/application.cpp src/client/ui/application.h Modified: data/Ships/Octavius/Apteryx/octavius_apteryx.mesh =================================================================== (Binary files differ) Modified: opengate.kdevelop =================================================================== --- opengate.kdevelop 2006-07-31 20:34:00 UTC (rev 144) +++ opengate.kdevelop 2006-07-31 20:34:53 UTC (rev 145) @@ -18,7 +18,7 @@ </general> <kdevautoproject> <general> - <activetarget>src/client/ogre/libopengate-ogre.la</activetarget> + <activetarget>src/client/ui/libopengate-ui.la</activetarget> <useconfiguration>debug</useconfiguration> <useactivetarget>true</useactivetarget> </general> Modified: src/client/ui/application.cpp =================================================================== --- src/client/ui/application.cpp 2006-07-31 20:34:00 UTC (rev 144) +++ src/client/ui/application.cpp 2006-07-31 20:34:53 UTC (rev 145) @@ -31,17 +31,18 @@ #include <CEGUI/CEGUIWindow.h> #include <CEGUI/elements/CEGUIPushButton.h> -OpengateApp::OpengateApp() : mGUIRenderer(0), mGUISystem(0), actionConfig(0) { - mFrameListener = 0; - mRoot = 0; +OpengateApp::OpengateApp() : mGUISystem(0), mGUIRenderer(0), actionConfig(0), mRoot(0), mFrameListener(0), mAvatar(0), mExCamera(0) { + } OpengateApp::~OpengateApp() { - delete actionConfig; delete mGUISystem; delete mGUIRenderer; - delete mFrameListener; + delete actionConfig; delete mRoot; + delete mFrameListener; + delete mAvatar; + delete mExCamera; } void OpengateApp::go(void) { @@ -111,14 +112,9 @@ mCamera->setPosition (0, 0, 0); // Required or else the camera will have an offset // Main character - ogre = new OgreCharacter ("Ogre 1", mSceneMgr); - exCamera = new ExtendedCamera ("Extended Camera", mSceneMgr, mCamera); + mAvatar = new OgreCharacter ("Ogre 1", mSceneMgr); + mExCamera = new ExtendedCamera ("Extended Camera", mSceneMgr, mCamera); - - - Ogre::Entity* ent = mSceneMgr->createEntity( "Octavius Apteryx", "Ships/Octavius/Apteryx/octavius_apteryx.mesh" ); - mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent); - //--------------- setup GUI system ---------------------// mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr); @@ -153,7 +149,7 @@ OIS::JoyStick* joy = gUI->getJoyStick(); //Utility class for configuring, & testing ActionMap - actionConfig = new ActionConfig( mouse, kb, joy, mSceneMgr, ogre, exCamera); + actionConfig = new ActionConfig( mouse, kb, joy, mSceneMgr, mAvatar, mExCamera); } void OpengateApp::setupResources(void) { @@ -165,17 +161,14 @@ Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator(); Ogre::String secName, typeName, archName; - while (seci.hasMoreElements()) - { + while (seci.hasMoreElements()) { secName = seci.peekNextKey(); Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext(); Ogre::ConfigFile::SettingsMultiMap::iterator i; - for (i = settings->begin(); i != settings->end(); ++i) - { + for (i = settings->begin(); i != settings->end(); ++i) { typeName = i->first; archName = i->second; - Ogre::ResourceGroupManager::getSingleton().addResourceLocation( - archName, typeName, secName); + Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName); } } } Modified: src/client/ui/application.h =================================================================== --- src/client/ui/application.h 2006-07-31 20:34:00 UTC (rev 144) +++ src/client/ui/application.h 2006-07-31 20:34:53 UTC (rev 145) @@ -34,8 +34,17 @@ extern "C" { #endif +/*! + * \brief This class is the main class of the client. It binds together the user interface with the game logic. + * + * This class references everything else that lives on the clients side and is visible to the user or + * affected by input by the user. So you will find references to the users avatar, the input system and + * the camera. Most of the stuff here combines the world of OGRE with the world of CEGUI with the world + * of OIS. + * + * \author Christoph Brill + */ class OpengateApp { - public: OpengateApp(); ~OpengateApp(); @@ -43,19 +52,34 @@ private: - OgreCharacter *ogre; - ExtendedCamera *exCamera; + /*! Handle to the players avatar in this game */ + OgreCharacter *mAvatar; + /*! Handle to the camera that is used by the player */ + ExtendedCamera *mExCamera; + /*! Handle to the main menu rendering routines */ CEGUI::OgreCEGUIRenderer* mGUIRenderer; + /*! Handle to the user interface */ CEGUI::System* mGUISystem; + /*! Handle to the keybindings of the player */ ActionConfig *actionConfig; + /*! Handle to the root where everything from the OGRE-world lives */ Ogre::Root *mRoot; - Ogre::Camera* mCamera; + /*! Handle to the camera that is used by the player */ + Ogre::Camera* mCamera; //FIXME: remove an totally replace by mExCamera + /*! Handle to the scenemanager where the objects (like the avatar or the camera) live in */ Ogre::SceneManager* mSceneMgr; + /*! Handle to the framelistener (the thing that does changes to the ogre world) */ OpengateListener* mFrameListener; + /*! Handle to the window through which the player is looking into the opengate universe */ Ogre::RenderWindow* mWindow; + /*! + * \brief Creates the startscene + * + * This method + */ void createScene(void); void createFrameListener(void); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-07-31 20:34:08
|
Revision: 144 Author: egore Date: 2006-07-31 13:34:00 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=144&view=rev Log Message: ----------- update mask Property Changed: ---------------- data/ data/Ships/ data/Ships/Conflux/ Property changes on: data ___________________________________________________________________ Name: svn:ignore + Makefile.in Property changes on: data/Ships ___________________________________________________________________ Name: svn:ignore + Makefile.in Property changes on: data/Ships/Conflux ___________________________________________________________________ Name: svn:ignore + Makefile.in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-07-31 20:33:30
|
Revision: 143 Author: egore Date: 2006-07-31 13:33:26 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=143&view=rev Log Message: ----------- update mask Property Changed: ---------------- / Property changes on: ___________________________________________________________________ Name: svn:ignore + debug autom4te.cache Makefile.in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-07-31 20:32:23
|
Revision: 142 Author: egore Date: 2006-07-31 13:32:18 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=142&view=rev Log Message: ----------- add forgotten xml-parser Added Paths: ----------- website/game/include/parse_xml.php Added: website/game/include/parse_xml.php =================================================================== (Binary files differ) Property changes on: website/game/include/parse_xml.php ___________________________________________________________________ Name: svn:mime-type + application/x-httpd-php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-07-31 20:31:32
|
Revision: 141 Author: egore Date: 2006-07-31 13:31:25 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=141&view=rev Log Message: ----------- update data for new dtd Added Paths: ----------- website/opengate.dtd Added: website/opengate.dtd =================================================================== (Binary files differ) Property changes on: website/opengate.dtd ___________________________________________________________________ Name: svn:mime-type + application/xml-dtd This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-07-31 20:26:45
|
Revision: 140 Author: egore Date: 2006-07-31 13:26:33 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=140&view=rev Log Message: ----------- misc updates Modified Paths: -------------- website/game/database.php website/game/index.php website/screenshots.php Added Paths: ----------- website/game/css/ website/game/css/opengate.css Removed Paths: ------------- website/game/opengate.css Copied: website/game/css/opengate.css (from rev 114, website/game/opengate.css) =================================================================== --- website/game/css/opengate.css (rev 0) +++ website/game/css/opengate.css 2006-07-31 20:26:33 UTC (rev 140) @@ -0,0 +1,283 @@ +/* andreas08 - an open source xhtml/css website layout by Andreas Viklund - http://andreasviklund.com . Free to use in any way and for any purpose as long as the proper credits are given to the original designer. Version: 1.0, November 28, 2005 */ + +/**************** Body and tag styles ****************/ + +*{margin:0; padding:0;} + +body{ +font:76% Verdana,Tahoma,Arial,sans-serif; +line-height:1.4em; +text-align:center; +color:#303030; +background:#e8eaec; +} + +pre { + padding-top: 1.5em; + padding-bottom: 0em; + padding-left: 2em; + margin: 0.4em 0 0.4em 0; + font-size: medium; + font-family: monospace; + border: 1px solid #c0c0c0; + background-color: #fafbfc; +} + +code { + font-size: medium; + font-family: monospace; +} + +a{ +color:#467aa7; +font-weight:bold; +text-decoration:none; +background-color:inherit; +} + +a:hover{color:#2a5a8a; text-decoration:none; background-color:inherit;} +a img{border:none;} + +p{padding:0 0 1.6em 0;} +p form{margin-top:0; margin-bottom:20px;} + +img.left,img.center,img.right{padding:4px; border:1px solid #a0a0a0;} +img.left{float:left; margin:0 12px 5px 0;} +img.center{display:block; margin:0 auto 5px auto;} +img.right{float:right; margin:0 0 5px 12px;} + + + +h1,h2 { + margin-top: 10px; + margin-bottom: 15px; +} + +h3,h4,h5,h6 { + margin-top: 10px; + margin-bottom: 10px; +} + +/**************** Header and navigation styles ****************/ + +#container{ +width:1000px; +margin:20px auto; +padding:1px 0; +text-align:left; +background:#ffffff; +color:#303030; +border:2px solid #a0a0a0; +} + +#header{ +height:60px; +width:998px; +margin:0 1px 1px 1px; +background:#467aa7 url(images/logo.png) no-repeat left; +color:#ffffff; +} + +#header h1{ +padding:35px 0 0 20px; +font-size:2.4em; +background-color:inherit; +color:#ffffff; +letter-spacing:-2px; +font-weight:normal; +} + +#header h2{ +margin:10px 0 0 40px; +font-size:1.4em; +background-color:inherit; +color:#f0f2f4; +letter-spacing:-1px; +font-weight:normal; +} + +#navigation{ +height:2.2em; +line-height:2.2em; +width:998px; +margin:0 1px; +background:#578bb8; +color:#ffffff; +} + +#navigation li{ + float:left; + list-style-type:none; + border-right:1px solid #ffffff; + white-space:nowrap; +} + +#navigation li.selected{ + padding:0 10px; + display:block; + font-size:0.8em; + font-weight:normal; + text-transform:uppercase; + text-decoration:none; + color: #ffffff; +} + +#navigation li a{ +padding:0 10px; +display:block; +font-size:0.8em; +font-weight:normal; +text-transform:uppercase; +text-decoration:none; +background-color:inherit; +color: #ffffff; +} + +* html #navigation a {width:1%;} + +#navigation .selected,#navigation a:hover{ +background:#80b0da; +color:#ffffff; +text-decoration:none; +} + +/**************** Content styles ****************/ + +#content{ +float:left; +width:958px; +font-size:0.9em; +padding:20px 0 0 20px; +} + +#content h2{ +display:block; +margin:0 0 16px 0; +font-size:1.7em; +font-weight:normal; +letter-spacing:-1px; +color:#505050; +background-color:inherit; +} + +#content h2 a{font-weight:normal;} +#content h3{margin:0 0 5px 0; font-size:1.4em; letter-spacing:-1px;} +#content a:hover,#subcontent a:hover{text-decoration:underline;} +#content ul,#content ol{margin:0 5px 16px 35px;} +#content dl{margin:0 5px 10px 25px;} +#content dt{font-weight:bold; margin-bottom:5px;} +#content dd{margin:0 0 10px 15px;} + +/**************** Full-content styles ****************/ + +#fullcontent{ +font-size:0.9em; +padding:20px 20px 0 20px; +} + +#fullcontent h2{ +display:block; +margin:0 0 16px 0; +font-size:1.7em; +font-weight:normal; +letter-spacing:-1px; +color:#505050; +background-color:inherit; +} + +#fullcontent h2 a{font-weight:normal;} +#fullcontent h3{margin:0 0 5px 0; font-size:1.4em; letter-spacing:-1px;} +#fullcontent a:hover{text-decoration:underline;} +#fullcontent ul, +#fullcontent ol{margin:0 5px 16px 35px;} +#fullcontent dl{margin:0 5px 10px 25px;} +#fullcontent dt{font-weight:bold; margin-bottom:5px;} +#fullcontent dd{margin:0 0 10px 15px;} + +/**************** Sidebar styles ****************/ + +#subcontent{ +float:right; +width:170px; +padding:20px 20px 10px 0; +line-height:1.4em; +} + +#subcontent h2{ +display:block; +margin:0 0 15px 0; +font-size:1.6em; +font-weight:normal; +text-align:left; +letter-spacing:-1px; +color:#505050; +background-color:inherit; +} + +#subcontent p{margin:0 0 16px 0; font-size:0.9em;} + +/**************** Menublock styles ****************/ + +.menublock{margin:0 0 20px 8px; font-size:0.9em;} +.menublock li{list-style:none; display:block; padding:2px; margin-bottom:2px;} +.menublock li a{font-weight:bold; text-decoration:none;} +.menublock li a:hover{text-decoration:none;} +.menublock li ul{margin:3px 0 3px 15px; font-size:1em; font-weight:normal;} +.menublock li ul li{margin-bottom:0;} +.menublock li ul a{font-weight:normal;} + +/**************** Searchbar styles ****************/ + +#searchbar{margin:0 0 20px 0;} +#searchbar form fieldset{margin-left:10px; border:0 solid;} + +#searchbar #s{ +height:1.2em; +width:110px; +margin:0 5px 0 0; +border:1px solid #a0a0a0; +} + +#searchbar #searchbutton{ +width:auto; +padding:0 1px; +border:1px solid #808080; +font-size:0.9em; +text-align:center; +} + +/**************** Footer styles ****************/ + +#footer{ +clear:both; +width:998px; +padding:5px 0; +margin:0 1px; +font-size:0.9em; +color:#f0f0f0; +background:#467aa7; +} + +#footer p{padding:0; margin:0; text-align:center;} +#footer a{color:#f0f0f0; background-color:inherit; font-weight:bold;} +#footer a:hover{color:#ffffff; background-color:inherit; text-decoration: underline;} + +/**************** Misc classes and styles ****************/ + +.splitcontentleft{float:left; width:28%;} +.splitcontentright{float:right; width:68%;} +.clear{clear:both;} +.small{font-size:0.8em;} +.hide{display:none;} +.textcenter{text-align:center;} +.textright{text-align:right;} +.important{color:#f02025; background-color:inherit; font-weight:bold;} + +.box{ +margin:0 0 20px 0; +padding:10px; +border:1px solid #c0c0c0; +background-color:#fafbfc; +color:#505050; +line-height:1.5em; +} Modified: website/game/database.php =================================================================== (Binary files differ) Modified: website/game/index.php =================================================================== (Binary files differ) Deleted: website/game/opengate.css =================================================================== --- website/game/opengate.css 2006-07-31 19:45:06 UTC (rev 139) +++ website/game/opengate.css 2006-07-31 20:26:33 UTC (rev 140) @@ -1,283 +0,0 @@ -/* andreas08 - an open source xhtml/css website layout by Andreas Viklund - http://andreasviklund.com . Free to use in any way and for any purpose as long as the proper credits are given to the original designer. Version: 1.0, November 28, 2005 */ - -/**************** Body and tag styles ****************/ - -*{margin:0; padding:0;} - -body{ -font:76% Verdana,Tahoma,Arial,sans-serif; -line-height:1.4em; -text-align:center; -color:#303030; -background:#e8eaec; -} - -pre { - padding-top: 1.5em; - padding-bottom: 0em; - padding-left: 2em; - margin: 0.4em 0 0.4em 0; - font-size: medium; - font-family: monospace; - border: 1px solid #c0c0c0; - background-color: #fafbfc; -} - -code { - font-size: medium; - font-family: monospace; -} - -a{ -color:#467aa7; -font-weight:bold; -text-decoration:none; -background-color:inherit; -} - -a:hover{color:#2a5a8a; text-decoration:none; background-color:inherit;} -a img{border:none;} - -p{padding:0 0 1.6em 0;} -p form{margin-top:0; margin-bottom:20px;} - -img.left,img.center,img.right{padding:4px; border:1px solid #a0a0a0;} -img.left{float:left; margin:0 12px 5px 0;} -img.center{display:block; margin:0 auto 5px auto;} -img.right{float:right; margin:0 0 5px 12px;} - - - -h1,h2 { - margin-top: 10px; - margin-bottom: 15px; -} - -h3,h4,h5,h6 { - margin-top: 10px; - margin-bottom: 10px; -} - -/**************** Header and navigation styles ****************/ - -#container{ -width:1000px; -margin:20px auto; -padding:1px 0; -text-align:left; -background:#ffffff; -color:#303030; -border:2px solid #a0a0a0; -} - -#header{ -height:60px; -width:998px; -margin:0 1px 1px 1px; -background:#467aa7 url(images/logo.png) no-repeat left; -color:#ffffff; -} - -#header h1{ -padding:35px 0 0 20px; -font-size:2.4em; -background-color:inherit; -color:#ffffff; -letter-spacing:-2px; -font-weight:normal; -} - -#header h2{ -margin:10px 0 0 40px; -font-size:1.4em; -background-color:inherit; -color:#f0f2f4; -letter-spacing:-1px; -font-weight:normal; -} - -#navigation{ -height:2.2em; -line-height:2.2em; -width:998px; -margin:0 1px; -background:#578bb8; -color:#ffffff; -} - -#navigation li{ - float:left; - list-style-type:none; - border-right:1px solid #ffffff; - white-space:nowrap; -} - -#navigation li.selected{ - padding:0 10px; - display:block; - font-size:0.8em; - font-weight:normal; - text-transform:uppercase; - text-decoration:none; - color: #ffffff; -} - -#navigation li a{ -padding:0 10px; -display:block; -font-size:0.8em; -font-weight:normal; -text-transform:uppercase; -text-decoration:none; -background-color:inherit; -color: #ffffff; -} - -* html #navigation a {width:1%;} - -#navigation .selected,#navigation a:hover{ -background:#80b0da; -color:#ffffff; -text-decoration:none; -} - -/**************** Content styles ****************/ - -#content{ -float:left; -width:958px; -font-size:0.9em; -padding:20px 0 0 20px; -} - -#content h2{ -display:block; -margin:0 0 16px 0; -font-size:1.7em; -font-weight:normal; -letter-spacing:-1px; -color:#505050; -background-color:inherit; -} - -#content h2 a{font-weight:normal;} -#content h3{margin:0 0 5px 0; font-size:1.4em; letter-spacing:-1px;} -#content a:hover,#subcontent a:hover{text-decoration:underline;} -#content ul,#content ol{margin:0 5px 16px 35px;} -#content dl{margin:0 5px 10px 25px;} -#content dt{font-weight:bold; margin-bottom:5px;} -#content dd{margin:0 0 10px 15px;} - -/**************** Full-content styles ****************/ - -#fullcontent{ -font-size:0.9em; -padding:20px 20px 0 20px; -} - -#fullcontent h2{ -display:block; -margin:0 0 16px 0; -font-size:1.7em; -font-weight:normal; -letter-spacing:-1px; -color:#505050; -background-color:inherit; -} - -#fullcontent h2 a{font-weight:normal;} -#fullcontent h3{margin:0 0 5px 0; font-size:1.4em; letter-spacing:-1px;} -#fullcontent a:hover{text-decoration:underline;} -#fullcontent ul, -#fullcontent ol{margin:0 5px 16px 35px;} -#fullcontent dl{margin:0 5px 10px 25px;} -#fullcontent dt{font-weight:bold; margin-bottom:5px;} -#fullcontent dd{margin:0 0 10px 15px;} - -/**************** Sidebar styles ****************/ - -#subcontent{ -float:right; -width:170px; -padding:20px 20px 10px 0; -line-height:1.4em; -} - -#subcontent h2{ -display:block; -margin:0 0 15px 0; -font-size:1.6em; -font-weight:normal; -text-align:left; -letter-spacing:-1px; -color:#505050; -background-color:inherit; -} - -#subcontent p{margin:0 0 16px 0; font-size:0.9em;} - -/**************** Menublock styles ****************/ - -.menublock{margin:0 0 20px 8px; font-size:0.9em;} -.menublock li{list-style:none; display:block; padding:2px; margin-bottom:2px;} -.menublock li a{font-weight:bold; text-decoration:none;} -.menublock li a:hover{text-decoration:none;} -.menublock li ul{margin:3px 0 3px 15px; font-size:1em; font-weight:normal;} -.menublock li ul li{margin-bottom:0;} -.menublock li ul a{font-weight:normal;} - -/**************** Searchbar styles ****************/ - -#searchbar{margin:0 0 20px 0;} -#searchbar form fieldset{margin-left:10px; border:0 solid;} - -#searchbar #s{ -height:1.2em; -width:110px; -margin:0 5px 0 0; -border:1px solid #a0a0a0; -} - -#searchbar #searchbutton{ -width:auto; -padding:0 1px; -border:1px solid #808080; -font-size:0.9em; -text-align:center; -} - -/**************** Footer styles ****************/ - -#footer{ -clear:both; -width:998px; -padding:5px 0; -margin:0 1px; -font-size:0.9em; -color:#f0f0f0; -background:#467aa7; -} - -#footer p{padding:0; margin:0; text-align:center;} -#footer a{color:#f0f0f0; background-color:inherit; font-weight:bold;} -#footer a:hover{color:#ffffff; background-color:inherit; text-decoration: underline;} - -/**************** Misc classes and styles ****************/ - -.splitcontentleft{float:left; width:28%;} -.splitcontentright{float:right; width:68%;} -.clear{clear:both;} -.small{font-size:0.8em;} -.hide{display:none;} -.textcenter{text-align:center;} -.textright{text-align:right;} -.important{color:#f02025; background-color:inherit; font-weight:bold;} - -.box{ -margin:0 0 20px 0; -padding:10px; -border:1px solid #c0c0c0; -background-color:#fafbfc; -color:#505050; -line-height:1.5em; -} Modified: website/screenshots.php =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-07-31 19:45:25
|
Revision: 139 Author: egore Date: 2006-07-31 12:45:06 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=139&view=rev Log Message: ----------- start integrating the ogre tutorial for chase cameras Modified Paths: -------------- src/client/ui/ActionConfig.cpp src/client/ui/ActionConfig.h src/client/ui/Makefile.am src/client/ui/application.cpp src/client/ui/application.h src/client/ui/framelistener.cpp src/client/ui/framelistener.h Added Paths: ----------- src/client/ui/avatar.h src/client/ui/camera.h Modified: src/client/ui/ActionConfig.cpp =================================================================== --- src/client/ui/ActionConfig.cpp 2006-07-31 09:17:04 UTC (rev 138) +++ src/client/ui/ActionConfig.cpp 2006-07-31 19:45:06 UTC (rev 139) @@ -53,12 +53,16 @@ const int A_LOOK_RIGHT = 12; //Keyboard only setting const int A_CENTER_VIEW = 13; //All -const int A_TEST_DONE = 14; //Action that happens when Escape Pushed +const int A_CAM_3RD_FIXED = 14; //Keyboard only setting +const int A_CAM_3RD_CHASE = 15; //Keyboard only setting +const int A_CAM_1ST = 16; //Keyboard only setting +const int A_TEST_DONE = 17; //Action that happens when Escape Pushed + //--------------------------------------------------------------------------------// ActionConfig::ActionConfig( OIS::Mouse *mouse, OIS::Keyboard *key, OIS::JoyStick *joy, - Ogre::SceneManager* scnMgr ) : + Ogre::SceneManager* scnMgr, OgreCharacter *ogre, ExtendedCamera *exCamera) : mMouse(mouse), mKey(key), mJoy(joy), mSceneMgr(scnMgr) { //Create an ActionMap instance @@ -105,6 +109,10 @@ //Reset everything createScene(); reset(); + + mChar = ogre; + mExCamera = exCamera; + mMode = 0; } //--------------------------------------------------------------------------------// @@ -173,6 +181,10 @@ keyEvents.push_back(DemoActionEventInfo(A_LOOK_LEFT,KC_LEFT,OIS_Button,lookBind,"Look Left")); keyEvents.push_back(DemoActionEventInfo(A_LOOK_RIGHT,KC_RIGHT,OIS_Button,lookBind,"Look Right")); + keyEvents.push_back(DemoActionEventInfo(A_CAM_3RD_FIXED,KC_G,OIS_Button,lookBind,"Fix Camera")); + keyEvents.push_back(DemoActionEventInfo(A_CAM_3RD_CHASE,KC_H,OIS_Button,lookBind,"Chase Camera")); + keyEvents.push_back(DemoActionEventInfo(A_CAM_1ST,KC_J,OIS_Button,lookBind,"1st Camera")); + //Setup CEGUI stuff fillList(); } @@ -553,6 +565,31 @@ //--------------------------------------------------------------------------------// bool ActionConfig::frameStarted(const Ogre::FrameEvent& evt) { + + if (mChar) { + //FIXME:mChar->update (evt.timeSinceLastFrame, mInputDevice); + + if (mExCamera) { + switch (mMode) { + case 0: // 3rd person chase + mExCamera->update (evt.timeSinceLastFrame, + mChar->getCameraNode ()->getWorldPosition (), + mChar->getSightNode ()->getWorldPosition ()); + break; + case 1: // 3rd person fixed + mExCamera->update (evt.timeSinceLastFrame, + Ogre::Vector3 (0, 200, 0), + mChar->getSightNode ()->getWorldPosition ()); + break; + case 2: // 1st person + mExCamera->update (evt.timeSinceLastFrame, + mChar->getWorldPosition (), + mChar->getSightNode ()->getWorldPosition ()); + break; + } + } + } + Ogre::Camera *cam = mSceneMgr->getCamera("PlayerCam"); // Move about 100 units per second, @@ -742,6 +779,37 @@ //Centers/levels out - Don't care if button or axes case A_CENTER_VIEW: break; + + case A_CAM_1ST: + mMode = 2; + if (mChar) + static_cast<OgreCharacter *>(mChar)->setVisible (false); + if (mExCamera) { + if (mChar) + mExCamera->instantUpdate (mChar->getWorldPosition (), mChar->getSightNode ()->getWorldPosition ()); + mExCamera->setTightness (1.0f); + } + break; + case A_CAM_3RD_CHASE: + mMode = 0; + if (mChar) + static_cast<OgreCharacter *>(mChar)->setVisible (true); + if (mExCamera) { + if (mChar) + mExCamera->instantUpdate (mChar->getCameraNode ()->getWorldPosition (), mChar->getSightNode ()->getWorldPosition ()); + mExCamera->setTightness (0.01f); + } + break; + case A_CAM_3RD_FIXED: + mMode = 1; + if (mChar) + static_cast<OgreCharacter *>(mChar)->setVisible (true); + if (mExCamera) { + if (mChar) + mExCamera->instantUpdate (Ogre::Vector3 (0, 200, 0), mChar->getSightNode ()->getWorldPosition ()); + mExCamera->setTightness (0.01f); + } + break; default: break; } } Modified: src/client/ui/ActionConfig.h =================================================================== --- src/client/ui/ActionConfig.h 2006-07-31 09:17:04 UTC (rev 138) +++ src/client/ui/ActionConfig.h 2006-07-31 19:45:06 UTC (rev 139) @@ -32,6 +32,8 @@ #include "OgreVector3.h" #include "ActionMap.h" +#include "avatar.h" +#include "camera.h" //Simple utility structure that extends the one from ActionMap.. As we want to store //some additional info for configuring things @@ -65,7 +67,7 @@ { public: ActionConfig( OIS::Mouse *mouse, OIS::Keyboard *key, OIS::JoyStick *joy, - Ogre::SceneManager* scnMgr ); + Ogre::SceneManager* scnMgr, OgreCharacter *ogre, ExtendedCamera *exCamera); ~ActionConfig(); //Resets everything back to default - lists, actions, scene @@ -157,6 +159,14 @@ float mMoveScale; float mRotXScale; float mRotYScale; + + // References to the main character and the camera + Character *mChar; + ExtendedCamera *mExCamera; + + // Camera mode - Now supports 1st person, 3rd person (chasing) and 3rd person (fixed) + unsigned int mMode; + }; #endif Modified: src/client/ui/Makefile.am =================================================================== --- src/client/ui/Makefile.am 2006-07-31 09:17:04 UTC (rev 138) +++ src/client/ui/Makefile.am 2006-07-31 19:45:06 UTC (rev 139) @@ -3,4 +3,5 @@ noinst_LTLIBRARIES = libopengate-ui.la libopengate_ui_la_SOURCES = application.cpp framelistener.cpp ActionConfig.cpp \ ActionMap.cpp -noinst_HEADERS = application.h framelistener.h ActionConfig.h ActionMap.h +noinst_HEADERS = application.h framelistener.h ActionConfig.h ActionMap.h \ + camera.h Modified: src/client/ui/application.cpp =================================================================== --- src/client/ui/application.cpp 2006-07-31 09:17:04 UTC (rev 138) +++ src/client/ui/application.cpp 2006-07-31 19:45:06 UTC (rev 139) @@ -108,6 +108,14 @@ Ogre::Light* l = mSceneMgr->createLight("MainLight"); l->setPosition(20,80,50); + mCamera->setPosition (0, 0, 0); // Required or else the camera will have an offset + + // Main character + ogre = new OgreCharacter ("Ogre 1", mSceneMgr); + exCamera = new ExtendedCamera ("Extended Camera", mSceneMgr, mCamera); + + + Ogre::Entity* ent = mSceneMgr->createEntity( "Octavius Apteryx", "Ships/Octavius/Apteryx/octavius_apteryx.mesh" ); mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent); @@ -145,7 +153,7 @@ OIS::JoyStick* joy = gUI->getJoyStick(); //Utility class for configuring, & testing ActionMap - actionConfig = new ActionConfig( mouse, kb, joy, mSceneMgr ); + actionConfig = new ActionConfig( mouse, kb, joy, mSceneMgr, ogre, exCamera); } void OpengateApp::setupResources(void) { Modified: src/client/ui/application.h =================================================================== --- src/client/ui/application.h 2006-07-31 09:17:04 UTC (rev 138) +++ src/client/ui/application.h 2006-07-31 19:45:06 UTC (rev 139) @@ -42,6 +42,10 @@ void go(void); private: + + OgreCharacter *ogre; + ExtendedCamera *exCamera; + CEGUI::OgreCEGUIRenderer* mGUIRenderer; CEGUI::System* mGUISystem; ActionConfig *actionConfig; Added: src/client/ui/avatar.h =================================================================== --- src/client/ui/avatar.h (rev 0) +++ src/client/ui/avatar.h 2006-07-31 19:45:06 UTC (rev 139) @@ -0,0 +1,109 @@ +/*************************************************************************** + * avatar.h + * + * Mo Jul 31 20:28:11 CEST 2006 + * Copyright 2006 Christoph Brill + * Email <eg...@us...> + ****************************************************************************/ + +/* + * 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 of the License, 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _OPENGATE_AVATAR_ +#define _OPENGATE_AVATAR_ + +#include "Ogre.h" + +class Character { +// Attributes ------------------------------------------------------------------------------ + protected: + Ogre::SceneNode *mMainNode; // Main character node + Ogre::SceneNode *mSightNode; // "Sight" node - The character is supposed to be looking here + Ogre::SceneNode *mCameraNode; // Node for the chase camera + Ogre::Entity *mEntity; // Character entity + Ogre::SceneManager *mSceneMgr; + public: +// Methods --------------------------------------------------------------------------------- + protected: + public: + // Updates the character (movement...) + virtual void update (Ogre::Real elapsedTime, Ogre::InputReader *input) = 0; + // The three methods below returns the two camera-related nodes, + // and the current position of the character (for the 1st person camera) + Ogre::SceneNode *getSightNode () { + return mSightNode; + } + Ogre::SceneNode *getCameraNode () { + return mCameraNode; + } + Ogre::Vector3 getWorldPosition () { + return mMainNode->getWorldPosition (); + } +}; + +// Specialization of the Character class - Our dear Ogre :D +class OgreCharacter : public Character { +// Attributes ------------------------------------------------------------------------------ + protected: + Ogre::String mName; + public: +// Methods --------------------------------------------------------------------------------- + protected: + public: + OgreCharacter (Ogre::String name, Ogre::SceneManager *sceneMgr) { + // Setup basic member references + mName = name; + mSceneMgr = sceneMgr; + + // Setup basic node structure to handle 3rd person cameras + mMainNode = mSceneMgr->getRootSceneNode ()->createChildSceneNode (mName); + mSightNode = mMainNode->createChildSceneNode (mName + "_sight", Ogre::Vector3 (0, 0, 100)); + mCameraNode = mMainNode->createChildSceneNode (mName + "_camera", Ogre::Vector3 (0, 50, -100)); + + // Give this character a shape :) + mEntity = mSceneMgr->createEntity (mName, "Ships/Octavius/Apteryx/octavius_apteryx.mesh"); + mMainNode->attachObject (mEntity); + } + ~OgreCharacter () { + mMainNode->detachAllObjects (); + delete mEntity; + mMainNode->removeAndDestroyAllChildren (); + mSceneMgr->destroySceneNode (mName); + } + + void update (Ogre::Real elapsedTime, Ogre::InputReader *input) { + // Handle movement + if (input->isKeyDown (Ogre::KC_W)) { + mMainNode->translate (mMainNode->getOrientation () * Ogre::Vector3 (0, 0, 100 * elapsedTime)); + } + if (input->isKeyDown (Ogre::KC_S)) { + mMainNode->translate (mMainNode->getOrientation () * Ogre::Vector3 (0, 0, -50 * elapsedTime)); + } + if (input->isKeyDown (Ogre::KC_A)) { + mMainNode->yaw (Ogre::Radian (2 * elapsedTime)); + } + if (input->isKeyDown (Ogre::KC_D)) { + mMainNode->yaw (Ogre::Radian (-2 * elapsedTime)); + } + } + + // Change visibility - Useful for 1st person view ;) + void setVisible (bool visible) { + mMainNode->setVisible (visible); + } +}; + +#endif Property changes on: src/client/ui/avatar.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native Added: src/client/ui/camera.h =================================================================== --- src/client/ui/camera.h (rev 0) +++ src/client/ui/camera.h 2006-07-31 19:45:06 UTC (rev 139) @@ -0,0 +1,111 @@ +/*************************************************************************** + * camera.h + * + * Mo Jul 31 20:31:54 CEST 2006 + * Copyright 2006 Christoph Brill + * Email <eg...@us...> + ****************************************************************************/ + +/* + * 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 of the License, 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _OPENGATE_CAMERA_ +#define _OPENGATE_CAMERA_ + +#include "Ogre.h" + +// Our extended camera class +class ExtendedCamera { +// Attributes ------------------------------------------------------------------------------ + protected: + Ogre::SceneNode *mTargetNode; // The camera target + Ogre::SceneNode *mCameraNode; // The camera itself + Ogre::Camera *mCamera; // Ogre camera + + Ogre::SceneManager *mSceneMgr; + Ogre::String mName; + + bool mOwnCamera; // To know if the ogre camera binded has been created outside or inside of this class + + Ogre::Real mTightness; // Determines the movement of the camera - 1 means tight movement, while 0 means no movement + public: +// Methods --------------------------------------------------------------------------------- + protected: + public: + ExtendedCamera (Ogre::String name, Ogre::SceneManager *sceneMgr, Ogre::Camera *camera = 0) { + // Basic member references setup + mName = name; + mSceneMgr = sceneMgr; + + // Create the camera's node structure + mCameraNode = mSceneMgr->getRootSceneNode ()->createChildSceneNode (mName); + mTargetNode = mSceneMgr->getRootSceneNode ()->createChildSceneNode (mName + "_target"); + mCameraNode->setAutoTracking (true, mTargetNode); // The camera will always look at the camera target + mCameraNode->setFixedYawAxis (true); // Needed because of auto tracking + + // Create our camera if it wasn't passed as a parameter + if (camera == 0) { + mCamera = mSceneMgr->createCamera (mName); + mOwnCamera = true; + } + else { + mCamera = camera; + mOwnCamera = false; + } + // ... and attach the Ogre camera to the camera node + mCameraNode->attachObject (mCamera); + + // Default tightness + mTightness = 0.01f; + } + ~ExtendedCamera () { + mCameraNode->detachAllObjects (); + if (mOwnCamera) + delete mCamera; + mSceneMgr->destroySceneNode (mName); + mSceneMgr->destroySceneNode (mName + "_target"); + } + + void setTightness (Ogre::Real tightness) { + mTightness = tightness; + } + + Ogre::Real getTightness () { + return mTightness; + } + + Ogre::Vector3 getCameraPosition() { + return mCameraNode->getPosition(); + } + + void instantUpdate (Ogre::Vector3 cameraPosition, Ogre::Vector3 targetPosition) { + mCameraNode->setPosition(cameraPosition); + mTargetNode->setPosition(targetPosition); + } + + void update (Ogre::Real elapsedTime, Ogre::Vector3 cameraPosition, Ogre::Vector3 targetPosition) { + // Handle movement + Ogre::Vector3 displacement; + + displacement = (cameraPosition - mCameraNode->getPosition ()) * mTightness; + mCameraNode->translate (displacement); + + displacement = (targetPosition - mTargetNode->getPosition ()) * mTightness; + mTargetNode->translate (displacement); + } +}; + +#endif Property changes on: src/client/ui/camera.h ___________________________________________________________________ Name: svn:mime-type + text/x-c++hdr Name: svn:eol-style + native Modified: src/client/ui/framelistener.cpp =================================================================== --- src/client/ui/framelistener.cpp 2006-07-31 09:17:04 UTC (rev 138) +++ src/client/ui/framelistener.cpp 2006-07-31 19:45:06 UTC (rev 139) @@ -63,12 +63,9 @@ OIS::InputManager &im = *OIS::InputManager::createInputSystem( pl ); mKeyboard = static_cast<OIS::Keyboard*>(im.createInputObject( OIS::OISKeyboard, true )); mMouse = static_cast<OIS::Mouse*>(im.createInputObject( OIS::OISMouse, true )); - try - { + try { mJoy = static_cast<OIS::JoyStick*>(im.createInputObject( OIS::OISJoyStick, true )); - } - catch(...) - { + } catch(...) { mJoy = 0; } @@ -128,51 +125,17 @@ } bool OpengateListener::frameStarted(const Ogre::FrameEvent& evt) { - if(mWindow->isClosed()) + if(mWindow->isClosed()) { return false; + } //Need to capture/update each device mKeyboard->capture(); mMouse->capture(); - - if( mMouse->buffered() == false || mKeyboard->buffered() == false ) - { - // one of the input modes is immediate, so setup what is needed for immediate mouse/key movement - if (mTimeUntilNextToggle >= 0) - mTimeUntilNextToggle -= evt.timeSinceLastFrame; - - // If this is the first frame, pick a speed - if (evt.timeSinceLastFrame == 0) - { - mMoveScale = 1; - mRotScale = 0.1; - } - // Otherwise scale movement units by time passed since last frame - else - { - // Move about 100 units per second, - mMoveScale = mMoveSpeed * evt.timeSinceLastFrame; - // Take about 10 seconds for full rotation - mRotScale = mRotateSpeed * evt.timeSinceLastFrame; - } - mRotX = 0; - mRotY = 0; - mTranslateVector = Ogre::Vector3::ZERO; - - if( mKeyboard->buffered() == false ) - if (processUnbufferedKeyInput(evt) == false) - return false; - - if( mMouse->buffered() == false ) - if (processUnbufferedMouseInput(evt) == false) - return false; - - moveCamera(); - } - if( mJoy ) { mJoy->capture(); } + return true; } @@ -195,16 +158,17 @@ return true; } -bool OpengateListener::keyPressed( const OIS::KeyEvent &arg ) { - if( arg.key == OIS::KC_ESCAPE ) +bool OpengateListener::keyPressed(const OIS::KeyEvent &arg) { + if (arg.key == OIS::KC_ESCAPE) { mShutdownRequested = true; - CEGUI::System::getSingleton().injectKeyDown( arg.key ); - CEGUI::System::getSingleton().injectChar( arg.text ); + } + CEGUI::System::getSingleton().injectKeyDown(arg.key); + CEGUI::System::getSingleton().injectChar(arg.text); return true; } -bool OpengateListener::keyReleased( const OIS::KeyEvent &arg ) { - CEGUI::System::getSingleton().injectKeyUp( arg.key ); +bool OpengateListener::keyReleased(const OIS::KeyEvent &arg) { + CEGUI::System::getSingleton().injectKeyUp(arg.key); return true; } Modified: src/client/ui/framelistener.h =================================================================== --- src/client/ui/framelistener.h 2006-07-31 09:17:04 UTC (rev 138) +++ src/client/ui/framelistener.h 2006-07-31 19:45:06 UTC (rev 139) @@ -90,6 +90,7 @@ bool keyPressed( const OIS::KeyEvent &arg ); bool keyReleased( const OIS::KeyEvent &arg ); + }; #ifdef __cplusplus This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-07-31 09:17:16
|
Revision: 138 Author: egore Date: 2006-07-31 02:17:04 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=138&view=rev Log Message: ----------- start forum Modified Paths: -------------- website/game/admin.php website/game/index.php website/game/news.php website/game/stats.php Added Paths: ----------- website/game/forum.php website/game/include/forum_add.php.inc website/game/include/forum_browse.php.inc Modified: website/game/admin.php =================================================================== (Binary files differ) Added: website/game/forum.php =================================================================== (Binary files differ) Property changes on: website/game/forum.php ___________________________________________________________________ Name: svn:mime-type + application/x-httpd-php Added: website/game/include/forum_add.php.inc =================================================================== (Binary files differ) Property changes on: website/game/include/forum_add.php.inc ___________________________________________________________________ Name: svn:mime-type + application/x-httpd-php Added: website/game/include/forum_browse.php.inc =================================================================== (Binary files differ) Property changes on: website/game/include/forum_browse.php.inc ___________________________________________________________________ Name: svn:mime-type + application/x-httpd-php Modified: website/game/index.php =================================================================== (Binary files differ) Modified: website/game/news.php =================================================================== (Binary files differ) Modified: website/game/stats.php =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-07-30 19:54:12
|
Revision: 137 Author: egore Date: 2006-07-30 12:53:31 -0700 (Sun, 30 Jul 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=137&view=rev Log Message: ----------- resize the ship Modified Paths: -------------- data/Ships/Octavius/Apteryx/octavius_apteryx.wings Modified: data/Ships/Octavius/Apteryx/octavius_apteryx.wings =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2006-07-30 19:47:01
|
Revision: 136 Author: egore Date: 2006-07-30 12:46:11 -0700 (Sun, 30 Jul 2006) ViewCVS: http://svn.sourceforge.net/opengate/?rev=136&view=rev Log Message: ----------- commit in case I forgot it once Modified Paths: -------------- data/BaseInterior/Solrain/solrain.wings Modified: data/BaseInterior/Solrain/solrain.wings =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |