CVS Commit Info

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Message
Author
Yoghurt
Programmer
Posts: 376
Joined: Sat Jun 28, 2003 8:17 pm
Location: Heidelberg, Germany

#46 Post by Yoghurt »

Files affected:
universe/ServerUniverse.cpp

Purpose:
RomanNumerals now works for n<=3999

(Had nothing better to do, at least one thing that works as expected ;))

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

#47 Post by tzlaine »

Files affected:
IntroScreen.cpp
Removed MP demo code and replaced working code using the new MultiplayerLobbyWnd.

ServerConnectWnd.cpp
ServerConnectWnd.h
Complete rewrite; now you can find servers on your LAN, or connect to a server at a known IP address.

AIClientApp.cpp
Added support for the server renaming clients that duplicate names of already-joined players.

HumanClientApp.cpp
HumanClientApp.h
Added support for message passing to and from the new MultiplayerLobbyWnd and for the server renaming clients that duplicate names of already-joined players.

eng_stringtable.txt
Added strings needed by new MultiplayerLobbyWnd.

farming.png
industry.png
mining.png
pop.png
research.png
Updated to the new icons provided by miu.

ClientApp.cpp
ClientApp.h
ClientNetworkCore.cpp
ClientNetworkCore.h
Added support for message passing to and from the new MultiplayerLobbyWnd.

Message.cpp
Message.h
Added new Message-constructing free functions for use in the new MultiplayerLobbyWnd.

NetworkCore.cpp
NetworkCore.h
Changed and altered static members that are used to find LAN servers. Now searching for LAN servers works on localhost as well as other LAN hosts.

ServerNetworkCore.cpp
ServerNetworkCore.h
Moved PlayerInfo data from ServerApp down to this class, replacing ConnectionInfo. To accomodate this, EstablishPlayer was also rewritten to copy all player data needed by ServerApp into m_player_connection, though this class only knows about a subset of such data. This is to prevent the duplication of the contents of m_player_connection in ServerApp, and the resulting problems with keeping the data in synch.

NetworkDoc.txt
Added newly-implemented protions of protocol.

ServerApp.cpp
ServerApp.h
Implemented the portion of the FO networking code that allows an interactive MP lobby and the launch of MP games.

Purpose of change:
Multiplayer support is here! Now you can get something useful when you hit the "Multiplayer" button on the main menu. This is still a little rough around the edges, but it basically works as it should. There are no errors that I know of, but there are some things that I have not yet implemented. For instance, don't try to interact with the UI while searching the LAN for servers.

EDIT: I forgot to mention that GG has changed, or that the change is required for the new code. I am uploading the new WindowsKit.zip as I write this. Linux users, you should know what to do by now :).
Last edited by tzlaine on Sun Sep 28, 2003 7:19 am, edited 1 time in total.

jbarcz1
Creative Contributor
Posts: 226
Joined: Thu Jun 26, 2003 4:33 pm
Location: Baltimore, MD

#48 Post by jbarcz1 »

Files Modified
order.h/.cpp
random.h - commented out seed() function, which was giving me compilation problems
UniverseObject.cpp,
system.h/.cpp
Ship.cpp
Predicates.h
PopCenter.cpp
planet.cpp
fleet.h/.cpp
ServerApp.h/.cpp
Server.dev
ServerEmpireManager.cpp
ClientApp.h/.cpp
AIClient.dev
HumanClientApp.cpp
HumanClient.dev
MapWnd.cpp
SidePanel.cpp
SystemIcon.cpp
GalaxySetupWnd.h/.cpp

Files Added
util/AppInterface.h
util/AppInterface.cpp
universe/Universe.h
universe/Universe.cpp

Files Removed
universe/ClientUniverse.h
universe/ClientUniverse.cpp

Purpose of Change

The ClientUniverse and ServerUniverse classes have been merged into one big monolithic Universe class. THe same class is now used on the client and server. Because the name of the universe class is now Universe, all universe accessors have had to be renamed from Universe() to GetUniverse() (because Universe() looks like a constructor call)

In addition to the new universe class. I have also added an AppInterface file in order to remove most of the FREEORION_BUILD ifdefs. There are now global functions for accessing the empire, universe, and logger for each of the three apps we build. Their names and signatures are:
EmpireManager& Empires()
Universe& GetUniverse()
log4cpp::Category& Logger();

There are #ifdefs in AppInterface.cpp for each of these. This way, the only thing that needs to be rebuilt for the three apps is AppInterface.o (currently, universe.o also needs to be rebuilt because I had to retain an #ifdef there to keep a reference to ServerEmpireManager out of the client, I expect htis will change soon) I have not modified the object path so that all the .o files go to the same place, but that should probably be done sometime in the future.

NOTE: I am currently in the process of reconciling my changes with Zach's latest commit, which caused a few conflicts. As a result, I have not verified that my code meshes well with what's in the repository. I'll be doing a full checkout as soon as my commits are done, and will fix any problems I find tomorrow afternoon, unless Zach beats me to it ;)

NOTE #2: I have not done a linux build. Somebody needs to verify that it works.

Zach sez: These both have been done, FYI.
Empire Team Lead

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

#49 Post by tzlaine »

Files affected:
WindowsKit.zip
I had to add a rather obvious accessor to the RadioButtonGroup class, in order for the new MP UI to work smoothly.

MultiplayerLobbyWnd.cpp
Changed all references to universe from ClientUniverse to Universe.

Random.h
Added an explicit typecast to fix erroneous overload resolution problem.

Purpose of Change:
GG needed updating, MultiplayerLobbyWnd.cpp needed updating to reflect Josh's changes, and Random.h needed a small fix.

Note: I have just discovered that there is a known issue with the Windows build vis a vis the Galaxy setup stuff. Don't press "From file" unless you want to hide the game from your boss, because it will crash on you immediately.

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

#50 Post by tzlaine »

Files Affected:
ClientApp.cpp
There were some FREEORION_BUILD macros in this file that did not belong there. They're now gone.

Makefile
[All three manual makefiles]
These have been altered so that they use almost all of the same object files, to reduce duplicated complilations.

Purpose of Changes:
Now there are only three files that must be built more than once: Universe.cpp AppInterface.cpp, and ClientNetworkCore.cpp. Also, if you can't get the fancy build system to work (as I can't), you can use these much simpler, if less useful, Makefiles. Note that these Makefiles do not build dependency info.[/b]

jbarcz1
Creative Contributor
Posts: 226
Joined: Thu Jun 26, 2003 4:33 pm
Location: Baltimore, MD

#51 Post by jbarcz1 »

Files Affected
FleetWindow.h/.cpp

Purpose of Change
Just a minor update. Commiting some small changes I made, since this code may be changing ownership soon.
Empire Team Lead

jbarcz1
Creative Contributor
Posts: 226
Joined: Thu Jun 26, 2003 4:33 pm
Location: Baltimore, MD

#52 Post by jbarcz1 »

Files Affected
Order.h
Order.cpp

Purpose of Change

Added XML serialization to order classes. A static method in Order
called InitOrderFactory can be used to set up an XML object factory to construct orders.

The Execute() methods of the classes in the order hierarchy are now fully implemented. The usage of each of the orders is as follows:

PlanetBuild - changing the build focus of a planet
FleetMove - setting movement orders
FleetMerge - transferring ships between existing fleets
FleetSplit - creating a new fleet from ships in existing fleets
FleetColonize - colonizing a planet in the current system.

Each order has several preconditions, which are documented in Order.h
All of these preconditions are checked during execution and an std::runtime_error is thrown if any of them are violated. The code which executes orders server-side should trap this exception, log it, and deal with it (I recommend dealing with it by booting the offending client and replacing it with an AI)
Empire Team Lead

Almkaz
Space Floater
Posts: 31
Joined: Thu Sep 18, 2003 12:25 pm
Location: Ottawa, Canada

#53 Post by Almkaz »

Files affected:
MapWnd.cpp
Fixed the Wondws only bug with zooming the map window with the mouse wheel. The issue was that the framework would always send a move of 0 in addition to the normal move value. This was confusing the zoom algorithm.

Purpose of Change:
To fix a minor bug

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

#54 Post by tzlaine »

Files Affected:
AppInterface.h
AppInterface.cpp
Changed to reflect name change from ClientApp::Empire() to ClientApp::Empires().

ClientApp.h
ClientApp.cpp
Changed Empire() to Empires() to match ServerApp Empires() interface; also changes width-3 tabs to width-4.

ClientEmpireManager.cpp
Empire.h
ServerEmpireManager.cpp
ServerEmpireManager.h
Added ID number parameter to CreateEmpire, and changed some identifiers and formatting to reflect code standards.

ServerConnectWnd.cpp
Reduced server search timeout to 1 second.

SystemIcon.cpp
Implemented coloration of system names based on owning Empire.

SidePanel.cpp SidePanel.h
Implemented coloration of planet names based on owning Empire, turned off all demo code, and implemented PlanetBuildOrder generation.

HumanClientApp.cpp
Added SDL_INIT_EVENTTHREAD to Linux client SDL initialization, as required by FastEvents library documentation.

ClientNetworkCore.cpp
Eliminated queued SDL events in DiscoverLANServers() that was causing trouble in Linux.

ServerNetworkCore.cpp
ServerApp.cpp
ServerApp.h
Changed ServerStatus() to ServerStatusDoc() to match interface of other XMLDoc-creation functions.

Universe.cpp
Universe.h
Changed CreateEmpires() to create empires with the same ID numbers as their corresponding players.

OrderSet.h
OrderSet.cpp
Order.h
Order.cpp
Changed PlanetBuildOrder to use the build types in ProdCenter, and added Execute() call to Orders added to the OrderSet.

Planet.cpp
Planet.h
PopCenter.cpp
ProdCenter.cpp
ProdCenter.h
Partially implemented interturn phase functions and adjusted ProdCenter::BuildType to encompass all v0.1 build options.

Purpose of Change:
I turned off all the demo display stuff in the SidePanel, and turned of all interactive controls on planets that the player dies not own. I also implemented build orders from selection of items in the SidePanel's build DropDownList.

Tyreth
FreeOrion Lead Emeritus
Posts: 885
Joined: Thu Jun 26, 2003 6:23 am
Location: Australia

#55 Post by Tyreth »

Files affected:
UI/About.h
UI/MapWnd.cpp
UI/MapWnd.h
client/human/HumanClientApp.cpp
client/human/HumanClientApp.h
default/eng_stringtable.txt

Purpose of change:
Cleaned up some files. Added an options dialog to the map screen which
can be activated with F10. Implemented a temporary ShutDown function to HumanClientApp for the options quit button to use - which results in a segfault after shutting down. But it does quit you ;)
Save and Load buttons are placeholders and do nothing for now.

Edit: noticed some weirdness with keypresses. F10 will not be recognised until the left mouse button has been pressed at least once - after that it works fine. Any ideas why?

EDIT: The window needs to have the input focus before it can receive keypresses. Perhaps it's that you need to click it to give it the focus. If this is the case and you're constructing the window GG::Wnd::MODAL, that's a GG bug. -- Zach

Tyreth
FreeOrion Lead Emeritus
Posts: 885
Joined: Thu Jun 26, 2003 6:23 am
Location: Australia

#56 Post by Tyreth »

Files affected:
UI/InGameOptions.cpp
UI/InGameOptions.h

Purpose of change:
Whoops, forgot to add these to cvs when I committed the last changes. This is the class for the options dialog.

Tyreth
FreeOrion Lead Emeritus
Posts: 885
Joined: Thu Jun 26, 2003 6:23 am
Location: Australia

#57 Post by Tyreth »

Files affected:
UI/ClientUI.cpp

Purpose of change:
Changed alpha so that the side panel is darker, that way the stars and
planet names are less distracting behind it. Changed from 150 to 220.

Almkaz
Space Floater
Posts: 31
Joined: Thu Sep 18, 2003 12:25 pm
Location: Ottawa, Canada

#58 Post by Almkaz »

Added Turn Processing

Includes XMLEncoding/decoding of OrderSets, the execution of
orders and processing of universe objects for movement and growth. Also includes sending new universe
and empire data to the clients. As per design spec, the whole universe is sent over, not just what each empire can see.
Added ClientUI turn button and turn progress window.
This is really just the starting skeleton. A lot can be build from here including flushing out
the movement and gorwth methods for each universe object and adding SitRep reports.
There is also some AI - well it makes one decision - to end it's turn.

Files Effected:

TurnProgressWnd.h/cpp
New file for the turn progress window

ServerApp.cpp/h
Added message handling for turn updates,order updates
Added turn sequence map and methods for executing the turn

OrderSet.cpp/h
Added method that adds an order to an oder set without executing it first

TechLevel.cpp
Removed warning with constructor member initialization

ClientUI.cpp/h
Added turn progress window

MapWnd.cpp/h
Added end turn button

ClientApp.cpp/h
Added virtual function to end the turn. Encodes to XML ordersets and sends turn update message
It's virtual so UI clients can initialize and UI it needs

AIClientApp.cpp
Added handling of turn update messages. AI just ends it's turn

HumanClientApp.cpp/h
Added message handling for turn update and turn progress.

eng_stringtable.txt
Added strings for end turn button and turn progress window

Message.cpp/h
Added new functions for creating turn orders and turn update messages
Added new message for turn progress updating

PopCenter.cpp
Fixed typo in growth calulation

System.cpp
Fixed XML serialization for a given empire. Although empire-vsibility is
for the future, I did not relaize this until later and so this is fixed
for when we do use it

Universe.cpp
Fixed XML serialization for empire visibility. Although not used yet,
it will be in the future

UniverseObject.cpp
Fixed XML serialization for empire visibility. Although not used yet,
it will be in the future

Tyreth
FreeOrion Lead Emeritus
Posts: 885
Joined: Thu Jun 26, 2003 6:23 am
Location: Australia

#59 Post by Tyreth »

Files affected:
UI/MapWnd.cpp
client/human/HumanClientApp.cpp
client/human/HumanClientApp.h

Purpose of change:
Updated the quit button for in game options to work correct. Removed temporary code.

Tyreth
FreeOrion Lead Emeritus
Posts: 885
Joined: Thu Jun 26, 2003 6:23 am
Location: Australia

#60 Post by Tyreth »

Files affected:
UI/InGameOptions.cpp
UI/MapWnd.cpp

Purpose of change:
Very small change, just moved the quit code for ingameoptions. bit cleaner now.

Locked