Deprecated and deleted some unneeded files
Also merged misc/Notes.md into the GDD. I'll work on this soon.
This commit is contained in:
-242
@@ -1,242 +0,0 @@
|
||||
## Notes
|
||||
|
||||
The server holds the ultimate version of the world. The server has to handle log ons, logoffs, and world simulation. To do this, the server needs some sort of database system. I'd like to use something that is quick and efficient, which means that I'd probably end up using SQLite or something similar.
|
||||
|
||||
Monster AI/other world effects should be controlled with customizable scripts/specific file formats.
|
||||
|
||||
Should the server program have a UI? Or at least allow some sort of input at the terminal?
|
||||
|
||||
#### Template Item Information:
|
||||
* item type index
|
||||
* name
|
||||
* effect...
|
||||
|
||||
#### Template Item Information:
|
||||
* item index
|
||||
* item type
|
||||
* quantity
|
||||
|
||||
|
||||
#### Equipment
|
||||
Equipment should be items, but should the item object be placed in the equipment slot when it's equiped? Or should the slot gain certain traits, and the item is removed from the game?
|
||||
|
||||
#### Scratchings
|
||||
|
||||
* active time vs wait time battle system
|
||||
* the terrain you fight on affects the strength of spells and attacks
|
||||
|
||||
Server Room:
|
||||
* constructor
|
||||
* destructor
|
||||
* roomIndex
|
||||
* game map
|
||||
* player list
|
||||
* monster list
|
||||
* combat entrance list
|
||||
|
||||
Multithreading the network packets:
|
||||
* queue
|
||||
* function to push to the queue
|
||||
* function to retreive from the queue
|
||||
* Get the client running first
|
||||
|
||||
|
||||
I read in an article about magic being affected by the environment. What if in the ATB system, magic was affected by what type of terrain you were fighting on? Like, if you were in a volcano, fire magic was more powerful, but ice magic was weaker?
|
||||
|
||||
Unless you had an ice crystal to draw magic from, which makes up for the lack of ice magic sources, but the crystals only had limited amount of uses?
|
||||
|
||||
-------------------------
|
||||
|
||||
source: http://www.gamasutra.com/blogs/EvanJones/20130701/195361/Fewer_Options_More_Meaningful_Choices.php
|
||||
|
||||
Compare the tension created by this dynamic to that of the lack of drama inherent in the item system of most Final Fantasy titles. In those games, characters can suffer from a variety of status impairments that last for many battles (poison, blindness, silence, etc.) Each ailment has its own respective curative item that can cure no other ailments. Because the player is not limited by inventory space, she can always carry a wide selection of curative items at all times. Status ailments never feel particularly threatening: removing them is simply a chore to be dealt with rather than an interesting decision to be made. This also reduces the impact of items that can cure any ailment - why should a player be excited to gain access to these panaceas when she’s always had the ability to easily cure any ailment? The choice of what items to bring is rendered unimportant by the large amount of available inventory space.
|
||||
|
||||
|
||||
|
||||
|
||||
So I'm thinking about Boss Battles for the game. The game will have a drop in-drop out battle system, where if at least one person is still fighting the battle continues, but the people who drop out usually give something up in return (i.e. no exp, lose exp or gold, etc.) This will make permadeath easier on the players.
|
||||
|
||||
Anyway, for Boss battles, I want to encourage several people to take on a boss at once. one way to do this is to make the boss super strong, but I don't really want to rely on that. Another idea was to have several "minion" creatures that the boss uses.
|
||||
|
||||
i.e. You're fighting the Frog King, who summons four Frog Knights at the beginning of the battle. Every time a Frog Knight dies, a new one is summoned, so you're never fighting less than five creatures at once. The battle ends when the Frog King is dead, but the king never attacks you directly, instead summoning new Frog Knights, as well as healing and buffing the knights already on the field.
|
||||
|
||||
To defeat the Frog King, you can't just focus on him, since letting the Frog Knights attack you will almost always result in your death. So to defeat the knights and the king, the best strategy is to stun, incapacitate or draw the attention of the knights to other players, while one person attacks the king directly.
|
||||
|
||||
Now, although this would take a lot of mid level players to bring down, I could scale the number of knights being summoned in addition to the stats of the creatures for when there's only one or two players in the fight. With the drop in-drop out mechanic, I can scale the combat to match the number of players as well.
|
||||
|
||||
Anyway, this is ages away. I just wish development could go faster than it is right now. Making a video game is hard work, doubly so when you're doing it solo.
|
||||
|
||||
P.S. I need to add this post to the GDD.
|
||||
|
||||
|
||||
|
||||
|
||||
-------------------------
|
||||
|
||||
## Overall Requirements
|
||||
|
||||
An unmodified client must be able to connect to any server, be it vanilla, custom or modded.
|
||||
A server must allow the client to operate correctly.
|
||||
If any information causes issues, it must be resolved.
|
||||
If the source of the issue is the vanilla software, than that is the developer's responsibility to bring the software into line with the expected features.
|
||||
If however, the problem is caused by modified software or assets, than it is the responsibility of the server operator to resolve the issue.
|
||||
|
||||
-------------------------
|
||||
## Server Requirements
|
||||
|
||||
The server needs to handle the following content.
|
||||
|
||||
* server name
|
||||
* server version (including host name & modification status)
|
||||
* maximum player count
|
||||
* logon/logoff protocol
|
||||
* maintaining the client list (handling dropouts)
|
||||
* persistent player data (in a database or custom format)
|
||||
|
||||
#### Game Resource Distribution
|
||||
|
||||
If the client lacks a resource, the server needs to transmit that resource to the client upon connection.
|
||||
Resources transmitted include but are not limited to:
|
||||
|
||||
* map data
|
||||
* graphical assets
|
||||
* tilesets
|
||||
* sprites
|
||||
* audio assets
|
||||
* sound effects
|
||||
* background music
|
||||
* scripts
|
||||
* AI scripts
|
||||
* locational triggers
|
||||
|
||||
#### World Maps
|
||||
|
||||
The maps on a server are called rooms. For the data format, See [Map File Format](wiki/Map-File-Format).
|
||||
This is an example of the structure that a server's world can have. This isn't a requirement, but it can offer the easiest solutions.
|
||||
|
||||
* a singular "overworld", connecting different locations
|
||||
* dungeons, possibly instanced
|
||||
* player owned locations, like pirate ships, depending on a server's theme
|
||||
* any number of possible rooms running at the same time
|
||||
* each room is it's own little world
|
||||
|
||||
#### Game Events
|
||||
|
||||
This is an ambiguous section, covering several situations.
|
||||
|
||||
* instanced dungeons
|
||||
* player combat
|
||||
* timed events
|
||||
* locational events
|
||||
|
||||
#### Active Entities
|
||||
|
||||
All entities on the server have a unique, unsigned index.
|
||||
|
||||
* players
|
||||
* monsters
|
||||
* combat instances
|
||||
* pirate ships/vehicles
|
||||
* loot drops
|
||||
|
||||
-------------------------
|
||||
## Server Architecture
|
||||
|
||||
#### Modules
|
||||
|
||||
* server metadata
|
||||
* server name
|
||||
* version
|
||||
* distribution (official vs custom/name of the owner)
|
||||
* major.minor.patch
|
||||
* available map packs, resources, etc.
|
||||
* player count
|
||||
* maximum player count
|
||||
* global client list
|
||||
* global player list
|
||||
* global room list
|
||||
* global combat list -?
|
||||
|
||||
#### Client Information
|
||||
|
||||
* client index
|
||||
* player index
|
||||
* channel/address
|
||||
* last contact time (ping/keep alive)
|
||||
* ping count (number of times this client has been pinged, disconnect if it's
|
||||
too high)
|
||||
|
||||
#### Player Information
|
||||
|
||||
* player index
|
||||
* client index
|
||||
* handle
|
||||
* avatar
|
||||
* current location (room, coords)
|
||||
* inventory list
|
||||
* equipment list
|
||||
* friends list
|
||||
|
||||
#### Room Information
|
||||
|
||||
* room index
|
||||
* map data
|
||||
* player list
|
||||
* monster list
|
||||
* combat list
|
||||
* loot drop list
|
||||
|
||||
#### Combat Information
|
||||
|
||||
* combat index
|
||||
* room index
|
||||
* player list
|
||||
* monster list
|
||||
|
||||
-------------------------
|
||||
## Client Requirements
|
||||
|
||||
The client needs to handle the following content.
|
||||
|
||||
* user settings (name, avatar, etc.)
|
||||
* logon/logoff protocol
|
||||
* resource downloading/loading
|
||||
* user input
|
||||
* drawing to the screen
|
||||
* playing the correct information
|
||||
* client index
|
||||
* player index
|
||||
* room data
|
||||
* player list
|
||||
* monster list
|
||||
* etc.
|
||||
|
||||
-------------------------
|
||||
## Client Architecture
|
||||
|
||||
#### Scenes
|
||||
|
||||
* SplashScreen
|
||||
* start of the program
|
||||
* load the boilerplate resources
|
||||
* display the kr-studios logo
|
||||
* MainMenu
|
||||
* program hub
|
||||
* OptionScreen
|
||||
* custom config saved on exit
|
||||
* Lobby
|
||||
* find available servers
|
||||
* broadcast to the network
|
||||
* phone home -?
|
||||
* InWorld
|
||||
* the player is in a room
|
||||
* walk around the map
|
||||
* communicate with others on the map
|
||||
* InCombat
|
||||
* the player is in combat
|
||||
* return to the original room when finished
|
||||
|
||||
#### Modules
|
||||
|
||||
* map system
|
||||
* players
|
||||
@@ -1,84 +0,0 @@
|
||||
The Game Map
|
||||
|
||||
This section outlines the game’s map system. This system utilizes pagination to create a theoretically infinite game map, as well as supporting multiple tilesets in the same map. The goal of this design is to create a system with as much flexibility as possible, and simply enforcing a more rigid approach higher in the tool chain.
|
||||
|
||||
Tile
|
||||
|
||||
The Tile class is the basic unit of the map system, and is explicitly a POD (plain old data) structure. A tile has these members:
|
||||
|
||||
X Position
|
||||
Y Position
|
||||
Depth
|
||||
Width
|
||||
Height
|
||||
Tile Index
|
||||
|
||||
The tile’s X and Y positions are relative to their container region’s location. A tile’s depth allows multiple tiles to be drawn at the same location, and in the correct order; tiles with lower depths (including below zero) are drawn first. If a new tile has the same X position, Y position and depth as an existing tile, the old tile is overwritten.
|
||||
|
||||
The width and height members indicate the graphical size of the tile (not actually used when drawing), while the tile index is the specific tile for the sheet manager to draw. A negative value here is considered an error message.
|
||||
|
||||
Region
|
||||
|
||||
The region class has these members:
|
||||
|
||||
X Position
|
||||
Y Position
|
||||
Width
|
||||
Height
|
||||
Tile Container
|
||||
|
||||
Each region in a certain map must have the same width and height, and it’s X and Y positions must be multiples of those width and height values, respectfully. The outcome of this restriction is a theoretically infinite grid of region objects.
|
||||
|
||||
Each region holds a set of tiles corresponding to the region’s bounds. The tiles’ X and Y positions are relative to the regions’, so moving the region will move the tiles as well. A region object is created or loaded when a tile is place in it’s bounds; similarly, if a region has no tiles it should be deleted or removed from memory.
|
||||
|
||||
The exact width and height of a region has no significant impact, other than loading or transmission costs. The width and height of a map can be adjusted as needed.
|
||||
|
||||
Region Pager
|
||||
|
||||
The region pager class has these members:
|
||||
|
||||
Region Width
|
||||
Region Height
|
||||
On New Callback
|
||||
On Delete Callback
|
||||
Region Container
|
||||
|
||||
The Region Pager class holds a series of region objects, as well as creating and deleting them as needed. Every region theoretically exists at any time, so if a non-existent region object is requested, it is created and then returned. This class also has the Prune() method, which removes all regions out of bounds from memory, and the DrawTo method, which takes (among other things) the sheet manager for the map.
|
||||
|
||||
The width and height members must be set before the pager is used, and must not be changed while it still has regions loaded. These are used to create region objects as needed.
|
||||
|
||||
Each pager can also have two different callbacks set: “on new” and “on delete”. If either of these are set (that is, not null) then each region object’s address is passed to these after it is created or before it is destroyed, respectfully. The callbacks are intended to be used for domain specific processes, such as loading or saving data, or even requesting data from a remote server.
|
||||
|
||||
Tile Sheet
|
||||
|
||||
A tileset is a series of tile graphics stored in a single file. The tile sheet class loads a tile set into memory, and provides utilities for drawing them to the screen. The tile sheet class has these members:
|
||||
|
||||
Image
|
||||
X Count
|
||||
Y Count
|
||||
Total Count
|
||||
Begin
|
||||
End
|
||||
|
||||
The Image class is utilized heavily here by storing the graphical data and the tile size. Any file loaded into a sheet object must have all tile images arranged in a grid pattern, and they must all have the same width and height. The width and height must be provided when the file is loaded.
|
||||
|
||||
The X and Y counts are the number of tiles along the X and Y axis of the sheet’s image, and the total count is the number of tiles in the whole sheet (which is equal to the product of the X and Y counts).
|
||||
|
||||
Begin is the index of the first tile on the sheet (default is zero), and end is the index after the last tile (defaults to the value of total count). These indicate the range of the tiles, and are mostly used by the sheet manager. They are also used by the InRange() method, which checks to see if a certain tile is in that sheet.
|
||||
|
||||
Tile Sheet Manager
|
||||
|
||||
This class has these members:
|
||||
|
||||
Tile Sheet Container
|
||||
Range End
|
||||
|
||||
This class is a wrapper around a key-value container, using strings as the keys. Given a specific tile index, this class will draw the correct tile from the loaded sheets, or it throws an error.
|
||||
|
||||
Also, this class keeps track of the end of the sheet’s ranges.
|
||||
|
||||
TODO
|
||||
|
||||
Map File Format
|
||||
|
||||
TODO
|
||||
@@ -1,3 +0,0 @@
|
||||
This particular refactoring stage was absolute hell, mostly because I was wrestling with a severe bout of depression too. So, I've added the diffs, and a scary screenshot of the git console.
|
||||
|
||||
There are three diff files because server/server_application.cpp was split into two files: server/server_internals.cpp and server/server_connections.cpp, each with it's own diff.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB |
File diff suppressed because it is too large
Load Diff
@@ -1,394 +0,0 @@
|
||||
diff --git a/server/server_connections.cpp b/server/server_connections.cpp
|
||||
index 1a96d5b..2f35566 100644
|
||||
--- a/server/server_connections.cpp
|
||||
+++ b/server/server_connections.cpp
|
||||
@@ -21,212 +21,106 @@
|
||||
*/
|
||||
#include "server_application.hpp"
|
||||
|
||||
-#include "utility.hpp"
|
||||
-
|
||||
#include <stdexcept>
|
||||
#include <iostream>
|
||||
-#include <string>
|
||||
-
|
||||
-//-------------------------
|
||||
-//Define the public members
|
||||
-//-------------------------
|
||||
-
|
||||
-void ServerApplication::Init(int argc, char** argv) {
|
||||
- //NOTE: I might need to rearrange the init process so that lua & SQL can interact with the map system as needed.
|
||||
- std::cout << "Beginning startup" << std::endl;
|
||||
-
|
||||
- //initial setup
|
||||
- ClientEntry::uidCounter = 0;
|
||||
- PlayerEntry::uidCounter = 0;
|
||||
- config.Load("rsc\\config.cfg");
|
||||
-
|
||||
- //Init SDL
|
||||
- if (SDL_Init(0)) {
|
||||
- throw(std::runtime_error("Failed to initialize SDL"));
|
||||
- }
|
||||
- std::cout << "Initialized SDL" << std::endl;
|
||||
-
|
||||
- //Init SDL_net
|
||||
- if (SDLNet_Init()) {
|
||||
- throw(std::runtime_error("Failed to initialize SDL_net"));
|
||||
- }
|
||||
- network.Open(config.Int("server.port"), PACKET_BUFFER_SIZE);
|
||||
- std::cout << "Initialized SDL_net" << std::endl;
|
||||
-
|
||||
- //Init SQL
|
||||
- int ret = sqlite3_open_v2(config["server.dbname"].c_str(), &database, SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, nullptr);
|
||||
- if (ret != SQLITE_OK || !database) {
|
||||
- throw(std::runtime_error(std::string() + "Failed to initialize SQL: " + sqlite3_errmsg(database) ));
|
||||
- }
|
||||
- std::cout << "Initialized SQL" << std::endl;
|
||||
-
|
||||
- //setup the database
|
||||
- if (runSQLScript(database, config["dir.scripts"] + "setup_server.sql")) {
|
||||
- throw(std::runtime_error("Failed to initialize SQL's setup script"));
|
||||
- }
|
||||
- std::cout << "Initialized SQL's setup script" << std::endl;
|
||||
-
|
||||
- //lua
|
||||
- luaState = luaL_newstate();
|
||||
- if (!luaState) {
|
||||
- throw(std::runtime_error("Failed to initialize lua"));
|
||||
- }
|
||||
- luaL_openlibs(luaState);
|
||||
- std::cout << "Initialized lua" << std::endl;
|
||||
-
|
||||
- //run the startup script
|
||||
- if (luaL_dofile(luaState, (config["dir.scripts"] + "setup_server.lua").c_str())) {
|
||||
- throw(std::runtime_error(std::string() + "Failed to initialize lua's setup script: " + lua_tostring(luaState, -1) ));
|
||||
- }
|
||||
- std::cout << "Initialized lua's setup script" << std::endl;
|
||||
-
|
||||
- //setup the map object
|
||||
- regionPager.GetAllocator()->SetLuaState(luaState);
|
||||
- regionPager.GetFormat()->SetLuaState(luaState);
|
||||
- //TODO: config parameter
|
||||
- regionPager.GetFormat()->SetSaveDir("save/mapname/");
|
||||
-
|
||||
- std::cout << "Initialized the map system" << std::endl;
|
||||
- std::cout << "\tsizeof(SerialPacket): " << sizeof(SerialPacket) << std::endl;
|
||||
- std::cout << "\tPACKET_BUFFER_SIZE: " << PACKET_BUFFER_SIZE << std::endl;
|
||||
-
|
||||
- //finalize the startup
|
||||
- std::cout << "Startup completed successfully" << std::endl;
|
||||
-
|
||||
- //debugging
|
||||
- //
|
||||
-}
|
||||
-
|
||||
-void ServerApplication::Proc() {
|
||||
- SerialPacket packet;
|
||||
- while(running) {
|
||||
- //suck in the waiting packets & process them
|
||||
- while(network.Receive()) {
|
||||
- //get the packet
|
||||
- deserialize(&packet, network.GetInData());
|
||||
- //cache the source address
|
||||
- packet.meta.srcAddress = network.GetInPacket()->address;
|
||||
- //we need to go deeper
|
||||
- HandlePacket(packet);
|
||||
- }
|
||||
- //give the computer a break
|
||||
- SDL_Delay(10);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-void ServerApplication::Quit() {
|
||||
- std::cout << "Shutting down" << std::endl;
|
||||
- //empty the members
|
||||
- regionPager.UnloadAll();
|
||||
-
|
||||
- //APIs
|
||||
- lua_close(luaState);
|
||||
- sqlite3_close_v2(database);
|
||||
- network.Close();
|
||||
- SDLNet_Quit();
|
||||
- SDL_Quit();
|
||||
- std::cout << "Shutdown finished" << std::endl;
|
||||
-}
|
||||
-
|
||||
-//-------------------------
|
||||
-//Define the uber switch
|
||||
-//-------------------------
|
||||
-
|
||||
-void ServerApplication::HandlePacket(SerialPacket packet) {
|
||||
- switch(packet.meta.type) {
|
||||
- case SerialPacket::Type::BROADCAST_REQUEST:
|
||||
- HandleBroadcastRequest(packet);
|
||||
- break;
|
||||
- case SerialPacket::Type::JOIN_REQUEST:
|
||||
- HandleJoinRequest(packet);
|
||||
- break;
|
||||
- case SerialPacket::Type::DISCONNECT:
|
||||
- HandleDisconnect(packet);
|
||||
- break;
|
||||
- case SerialPacket::Type::SYNCHRONIZE:
|
||||
- HandleSynchronize(packet);
|
||||
- break;
|
||||
- case SerialPacket::Type::SHUTDOWN:
|
||||
- HandleShutdown(packet);
|
||||
- break;
|
||||
- case SerialPacket::Type::PLAYER_NEW:
|
||||
- HandlePlayerNew(packet);
|
||||
- break;
|
||||
- case SerialPacket::Type::PLAYER_DELETE:
|
||||
- HandlePlayerDelete(packet);
|
||||
- break;
|
||||
- case SerialPacket::Type::PLAYER_UPDATE:
|
||||
- HandlePlayerUpdate(packet);
|
||||
- break;
|
||||
- case SerialPacket::Type::REGION_REQUEST:
|
||||
- HandleRegionRequest(packet);
|
||||
- break;
|
||||
- //handle errors
|
||||
- default:
|
||||
- throw(std::runtime_error("Unknown SerialPacket::Type encountered"));
|
||||
- break;
|
||||
- }
|
||||
-}
|
||||
|
||||
//-------------------------
|
||||
//Handle various network input
|
||||
//-------------------------
|
||||
|
||||
void ServerApplication::HandleBroadcastRequest(SerialPacket packet) {
|
||||
- //send back the server's metadata
|
||||
+ //pack the server's data
|
||||
packet.meta.type = SerialPacket::Type::BROADCAST_RESPONSE;
|
||||
-
|
||||
- //pack the data
|
||||
+ packet.serverInfo.networkVersion = NETWORK_VERSION;
|
||||
snprintf(packet.serverInfo.name, PACKET_STRING_SIZE, "%s", config["server.name"].c_str());
|
||||
packet.serverInfo.playerCount = playerMap.size();
|
||||
- packet.serverInfo.regionWidth = REGION_WIDTH;
|
||||
- packet.serverInfo.regionHeight = REGION_HEIGHT;
|
||||
- packet.serverInfo.regionDepth = REGION_DEPTH;
|
||||
|
||||
- //send the data
|
||||
+ //bounce this packet
|
||||
char buffer[PACKET_BUFFER_SIZE];
|
||||
serialize(&packet, buffer);
|
||||
network.Send(&packet.meta.srcAddress, buffer, PACKET_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
void ServerApplication::HandleJoinRequest(SerialPacket packet) {
|
||||
- //register the new client
|
||||
+ //create the new client
|
||||
ClientEntry newClient;
|
||||
newClient.address = packet.meta.srcAddress;
|
||||
- clientMap[ClientEntry::uidCounter] = newClient;
|
||||
|
||||
- //send the client their index
|
||||
- char buffer[PACKET_BUFFER_SIZE];
|
||||
+ //TODO: move this into the player management code
|
||||
+ //create the new player
|
||||
+ PlayerEntry newPlayer;
|
||||
+ newPlayer.clientIndex = ClientEntry::uidCounter;
|
||||
+ newPlayer.player = packet.clientInfo.player;
|
||||
+ newPlayer.handle = packet.clientInfo.handle;
|
||||
+ newPlayer.avatar = packet.clientInfo.avatar;
|
||||
+
|
||||
+ //send the client their info
|
||||
packet.meta.type = SerialPacket::Type::JOIN_RESPONSE;
|
||||
- packet.clientInfo.index = ClientEntry::uidCounter;
|
||||
- serialize(&packet, buffer);
|
||||
+ packet.clientInfo.clientIndex = ClientEntry::uidCounter;
|
||||
+ packet.clientInfo.playerIndex = PlayerEntry::uidCounter;
|
||||
|
||||
//bounce this packet
|
||||
+ char buffer[PACKET_BUFFER_SIZE];
|
||||
+ serialize(&packet, buffer);
|
||||
network.Send(&newClient.address, buffer, PACKET_BUFFER_SIZE);
|
||||
|
||||
+ //send the new player to all clients
|
||||
+ packet.meta.type = SerialPacket::Type::PLAYER_NEW;
|
||||
+ packet.playerInfo.playerIndex = PlayerEntry::uidCounter;
|
||||
+ strncpy(packet.playerInfo.handle, newPlayer.handle.c_str(), PACKET_STRING_SIZE);
|
||||
+ strncpy(packet.playerInfo.avatar, newPlayer.avatar.c_str(), PACKET_STRING_SIZE);
|
||||
+ packet.playerInfo.position = newPlayer.position;
|
||||
+ packet.playerInfo.motion = newPlayer.motion;
|
||||
+ PumpPacket(packet);
|
||||
+
|
||||
//finished this routine
|
||||
+ clientMap[ClientEntry::uidCounter] = newClient;
|
||||
+ playerMap[PlayerEntry::uidCounter] = newPlayer;
|
||||
ClientEntry::uidCounter++;
|
||||
+ PlayerEntry::uidCounter++;
|
||||
std::cout << "Connect, total: " << clientMap.size() << std::endl;
|
||||
}
|
||||
|
||||
+void ServerApplication::HandleSynchronize(SerialPacket packet) {
|
||||
+ //TODO: compensate for large distances
|
||||
+
|
||||
+ //send all the server's data to this client
|
||||
+ SerialPacket newPacket;
|
||||
+ char buffer[PACKET_BUFFER_SIZE];
|
||||
+
|
||||
+ //players
|
||||
+ newPacket.meta.type = SerialPacket::Type::PLAYER_UPDATE;
|
||||
+ for (auto& it : playerMap) {
|
||||
+ //TODO: update this for the expanded PlayerEntry structure
|
||||
+ newPacket.playerInfo.playerIndex = it.first;
|
||||
+ snprintf(newPacket.playerInfo.handle, PACKET_STRING_SIZE, "%s", it.second.handle.c_str());
|
||||
+ snprintf(newPacket.playerInfo.avatar, PACKET_STRING_SIZE, "%s", it.second.avatar.c_str());
|
||||
+ newPacket.playerInfo.mapIndex = it.second.mapIndex;
|
||||
+ newPacket.playerInfo.position = it.second.position;
|
||||
+ newPacket.playerInfo.motion = it.second.motion;
|
||||
+ serialize(&newPacket, buffer);
|
||||
+ network.Send(&clientMap[packet.clientInfo.clientIndex].address, buffer, PACKET_BUFFER_SIZE);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void ServerApplication::HandleDisconnect(SerialPacket packet) {
|
||||
//TODO: authenticate who is disconnecting/kicking
|
||||
+ //TODO: define the difference between unloading and deletng a player
|
||||
|
||||
//disconnect the specified client
|
||||
char buffer[PACKET_BUFFER_SIZE];
|
||||
serialize(&packet, buffer);
|
||||
- network.Send(&clientMap[packet.clientInfo.index].address, buffer, PACKET_BUFFER_SIZE);
|
||||
- clientMap.erase(packet.clientInfo.index);
|
||||
+ network.Send(&clientMap[packet.clientInfo.clientIndex].address, buffer, PACKET_BUFFER_SIZE);
|
||||
+ clientMap.erase(packet.clientInfo.clientIndex);
|
||||
|
||||
//prep the delete packet
|
||||
SerialPacket delPacket;
|
||||
delPacket.meta.type = SerialPacket::Type::PLAYER_DELETE;
|
||||
|
||||
- //TODO: can this use DeletePlayer() instead?
|
||||
//delete server and client side players
|
||||
- erase_if(playerMap, [&](std::pair<unsigned int, PlayerEntry> it) -> bool {
|
||||
+ erase_if(playerMap, [&](std::pair<int, PlayerEntry> it) -> bool {
|
||||
//find the internal players to delete
|
||||
- if (it.second.clientIndex == packet.clientInfo.index) {
|
||||
+ if (it.second.clientIndex == packet.clientInfo.clientIndex) {
|
||||
//send the delete player command to all clients
|
||||
delPacket.playerInfo.playerIndex = it.first;
|
||||
PumpPacket(delPacket);
|
||||
@@ -243,102 +137,23 @@ void ServerApplication::HandleDisconnect(SerialPacket packet) {
|
||||
std::cout << "Disconnect, total: " << clientMap.size() << std::endl;
|
||||
}
|
||||
|
||||
-void ServerApplication::HandleSynchronize(SerialPacket packet) {
|
||||
- //TODO: compensate for large distances
|
||||
-
|
||||
- //send all the server's data to this client
|
||||
- SerialPacket newPacket;
|
||||
- char buffer[PACKET_BUFFER_SIZE];
|
||||
-
|
||||
- //players
|
||||
- newPacket.meta.type = SerialPacket::Type::PLAYER_UPDATE;
|
||||
- for (auto& it : playerMap) {
|
||||
- //TODO: update this for the expanded PlayerEntry structure
|
||||
- newPacket.playerInfo.playerIndex = it.first;
|
||||
- snprintf(newPacket.playerInfo.handle, PACKET_STRING_SIZE, "%s", it.second.handle.c_str());
|
||||
- snprintf(newPacket.playerInfo.avatar, PACKET_STRING_SIZE, "%s", it.second.avatar.c_str());
|
||||
- newPacket.playerInfo.position = it.second.position;
|
||||
- newPacket.playerInfo.motion = it.second.motion;
|
||||
- serialize(&newPacket, buffer);
|
||||
- network.Send(&clientMap[packet.clientInfo.index].address, buffer, PACKET_BUFFER_SIZE);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
void ServerApplication::HandleShutdown(SerialPacket packet) {
|
||||
+ //TODO: authenticate who is shutting the server down
|
||||
+
|
||||
//end the server
|
||||
running = false;
|
||||
|
||||
//disconnect all clients
|
||||
packet.meta.type = SerialPacket::Type::DISCONNECT;
|
||||
+ packet.clientInfo.clientIndex = -1;
|
||||
PumpPacket(packet);
|
||||
|
||||
//finished this routine
|
||||
std::cout << "Shutdown signal accepted" << std::endl;
|
||||
}
|
||||
|
||||
-void ServerApplication::HandlePlayerNew(SerialPacket packet) {
|
||||
- //register the new PlayerEntry
|
||||
- //NOTE: assigning each field one-by-one so adding or moving a field doesn't break this code
|
||||
- PlayerEntry newPlayer;
|
||||
-
|
||||
- //metadata
|
||||
- newPlayer.clientIndex = packet.playerInfo.clientIndex;
|
||||
- newPlayer.handle = packet.playerInfo.handle;
|
||||
- newPlayer.avatar = packet.playerInfo.avatar;
|
||||
-
|
||||
- //position
|
||||
- newPlayer.mapIndex = 0;
|
||||
- newPlayer.position = {0,0};
|
||||
- newPlayer.motion = {0,0};
|
||||
- newPlayer.bbox = {0, 0, 0, 0};
|
||||
-
|
||||
- //TODO: Add the statistic creation code here
|
||||
-
|
||||
- //push this player
|
||||
- playerMap[PlayerEntry::uidCounter] = newPlayer;
|
||||
-
|
||||
- //send the client their info
|
||||
- packet.playerInfo.playerIndex = PlayerEntry::uidCounter;
|
||||
- packet.playerInfo.position = newPlayer.position;
|
||||
- packet.playerInfo.motion = newPlayer.motion;
|
||||
-
|
||||
- //actually send to everyone
|
||||
- PumpPacket(packet);
|
||||
-
|
||||
- //finish this routine
|
||||
- PlayerEntry::uidCounter++;
|
||||
-}
|
||||
-
|
||||
-//TODO: differentiate between delete and unload
|
||||
-void ServerApplication::HandlePlayerDelete(SerialPacket packet) {
|
||||
- //TODO: authenticate who is deleting this player
|
||||
- if (playerMap.find(packet.playerInfo.playerIndex) == playerMap.end()) {
|
||||
- throw(std::runtime_error("Cannot delete a non-existant player"));
|
||||
- }
|
||||
-
|
||||
- //TODO: remove the deleted player from the database?
|
||||
-
|
||||
- //prep the delete packet
|
||||
- SerialPacket delPacket;
|
||||
- delPacket.meta.type = SerialPacket::Type::PLAYER_DELETE;
|
||||
-
|
||||
- //delete the specified playerEntry
|
||||
- erase_if(playerMap, [&](std::pair<unsigned int, PlayerEntry> it) -> bool {
|
||||
- //find the specified PlayerEntry
|
||||
- if (it.first == packet.playerInfo.playerIndex) {
|
||||
- //send to all
|
||||
- delPacket.playerInfo.playerIndex = it.first;
|
||||
- PumpPacket(delPacket);
|
||||
-
|
||||
- //delete this player
|
||||
- return true;
|
||||
- }
|
||||
- //skip this player
|
||||
- return false;
|
||||
- });
|
||||
-}
|
||||
-
|
||||
void ServerApplication::HandlePlayerUpdate(SerialPacket packet) {
|
||||
+ //TODO: this should be moved elsewhere
|
||||
if (playerMap.find(packet.playerInfo.playerIndex) == playerMap.end()) {
|
||||
throw(std::runtime_error("Cannot update a non-existant player"));
|
||||
}
|
||||
@@ -351,9 +166,12 @@ void ServerApplication::HandlePlayerUpdate(SerialPacket packet) {
|
||||
}
|
||||
|
||||
void ServerApplication::HandleRegionRequest(SerialPacket packet) {
|
||||
- char buffer[PACKET_BUFFER_SIZE];
|
||||
+ //TODO: this should be moved elsewhere
|
||||
packet.meta.type = SerialPacket::Type::REGION_CONTENT;
|
||||
packet.regionInfo.region = regionPager.GetRegion(packet.regionInfo.x, packet.regionInfo.y);
|
||||
+
|
||||
+ //send the content
|
||||
+ char buffer[PACKET_BUFFER_SIZE];
|
||||
serialize(&packet, buffer);
|
||||
network.Send(&packet.meta.srcAddress, buffer, PACKET_BUFFER_SIZE);
|
||||
}
|
||||
@@ -1,284 +0,0 @@
|
||||
diff --git a/server/server_internals.cpp b/server/server_internals.cpp
|
||||
index 1a96d5b..e1a9cb9 100644
|
||||
--- a/server/server_internals.cpp
|
||||
+++ b/server/server_internals.cpp
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* Copyright: (c) Kayne Ruse 2013, 2014
|
||||
+/* Copyright: (c) Kayne Ruse 2014
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
#include "server_application.hpp"
|
||||
|
||||
-#include "utility.hpp"
|
||||
+#include "server_utility.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <iostream>
|
||||
@@ -36,8 +36,6 @@ void ServerApplication::Init(int argc, char** argv) {
|
||||
std::cout << "Beginning startup" << std::endl;
|
||||
|
||||
//initial setup
|
||||
- ClientEntry::uidCounter = 0;
|
||||
- PlayerEntry::uidCounter = 0;
|
||||
config.Load("rsc\\config.cfg");
|
||||
|
||||
//Init SDL
|
||||
@@ -109,6 +107,8 @@ void ServerApplication::Proc() {
|
||||
//we need to go deeper
|
||||
HandlePacket(packet);
|
||||
}
|
||||
+ //update the internals
|
||||
+ //TODO: update the internals i.e. player positions
|
||||
//give the computer a break
|
||||
SDL_Delay(10);
|
||||
}
|
||||
@@ -116,6 +116,10 @@ void ServerApplication::Proc() {
|
||||
|
||||
void ServerApplication::Quit() {
|
||||
std::cout << "Shutting down" << std::endl;
|
||||
+
|
||||
+ //save the server state
|
||||
+ //TODO: save the existing players
|
||||
+
|
||||
//empty the members
|
||||
regionPager.UnloadAll();
|
||||
|
||||
@@ -125,6 +129,7 @@ void ServerApplication::Quit() {
|
||||
network.Close();
|
||||
SDLNet_Quit();
|
||||
SDL_Quit();
|
||||
+
|
||||
std::cout << "Shutdown finished" << std::endl;
|
||||
}
|
||||
|
||||
@@ -140,21 +145,15 @@ void ServerApplication::HandlePacket(SerialPacket packet) {
|
||||
case SerialPacket::Type::JOIN_REQUEST:
|
||||
HandleJoinRequest(packet);
|
||||
break;
|
||||
- case SerialPacket::Type::DISCONNECT:
|
||||
- HandleDisconnect(packet);
|
||||
- break;
|
||||
case SerialPacket::Type::SYNCHRONIZE:
|
||||
HandleSynchronize(packet);
|
||||
break;
|
||||
+ case SerialPacket::Type::DISCONNECT:
|
||||
+ HandleDisconnect(packet);
|
||||
+ break;
|
||||
case SerialPacket::Type::SHUTDOWN:
|
||||
HandleShutdown(packet);
|
||||
break;
|
||||
- case SerialPacket::Type::PLAYER_NEW:
|
||||
- HandlePlayerNew(packet);
|
||||
- break;
|
||||
- case SerialPacket::Type::PLAYER_DELETE:
|
||||
- HandlePlayerDelete(packet);
|
||||
- break;
|
||||
case SerialPacket::Type::PLAYER_UPDATE:
|
||||
HandlePlayerUpdate(packet);
|
||||
break;
|
||||
@@ -167,202 +166,3 @@ void ServerApplication::HandlePacket(SerialPacket packet) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
-
|
||||
-//-------------------------
|
||||
-//Handle various network input
|
||||
-//-------------------------
|
||||
-
|
||||
-void ServerApplication::HandleBroadcastRequest(SerialPacket packet) {
|
||||
- //send back the server's metadata
|
||||
- packet.meta.type = SerialPacket::Type::BROADCAST_RESPONSE;
|
||||
-
|
||||
- //pack the data
|
||||
- snprintf(packet.serverInfo.name, PACKET_STRING_SIZE, "%s", config["server.name"].c_str());
|
||||
- packet.serverInfo.playerCount = playerMap.size();
|
||||
- packet.serverInfo.regionWidth = REGION_WIDTH;
|
||||
- packet.serverInfo.regionHeight = REGION_HEIGHT;
|
||||
- packet.serverInfo.regionDepth = REGION_DEPTH;
|
||||
-
|
||||
- //send the data
|
||||
- char buffer[PACKET_BUFFER_SIZE];
|
||||
- serialize(&packet, buffer);
|
||||
- network.Send(&packet.meta.srcAddress, buffer, PACKET_BUFFER_SIZE);
|
||||
-}
|
||||
-
|
||||
-void ServerApplication::HandleJoinRequest(SerialPacket packet) {
|
||||
- //register the new client
|
||||
- ClientEntry newClient;
|
||||
- newClient.address = packet.meta.srcAddress;
|
||||
- clientMap[ClientEntry::uidCounter] = newClient;
|
||||
-
|
||||
- //send the client their index
|
||||
- char buffer[PACKET_BUFFER_SIZE];
|
||||
- packet.meta.type = SerialPacket::Type::JOIN_RESPONSE;
|
||||
- packet.clientInfo.index = ClientEntry::uidCounter;
|
||||
- serialize(&packet, buffer);
|
||||
-
|
||||
- //bounce this packet
|
||||
- network.Send(&newClient.address, buffer, PACKET_BUFFER_SIZE);
|
||||
-
|
||||
- //finished this routine
|
||||
- ClientEntry::uidCounter++;
|
||||
- std::cout << "Connect, total: " << clientMap.size() << std::endl;
|
||||
-}
|
||||
-
|
||||
-void ServerApplication::HandleDisconnect(SerialPacket packet) {
|
||||
- //TODO: authenticate who is disconnecting/kicking
|
||||
-
|
||||
- //disconnect the specified client
|
||||
- char buffer[PACKET_BUFFER_SIZE];
|
||||
- serialize(&packet, buffer);
|
||||
- network.Send(&clientMap[packet.clientInfo.index].address, buffer, PACKET_BUFFER_SIZE);
|
||||
- clientMap.erase(packet.clientInfo.index);
|
||||
-
|
||||
- //prep the delete packet
|
||||
- SerialPacket delPacket;
|
||||
- delPacket.meta.type = SerialPacket::Type::PLAYER_DELETE;
|
||||
-
|
||||
- //TODO: can this use DeletePlayer() instead?
|
||||
- //delete server and client side players
|
||||
- erase_if(playerMap, [&](std::pair<unsigned int, PlayerEntry> it) -> bool {
|
||||
- //find the internal players to delete
|
||||
- if (it.second.clientIndex == packet.clientInfo.index) {
|
||||
- //send the delete player command to all clients
|
||||
- delPacket.playerInfo.playerIndex = it.first;
|
||||
- PumpPacket(delPacket);
|
||||
-
|
||||
- //delete this player object
|
||||
- return true;
|
||||
- }
|
||||
-
|
||||
- //don't delete this player object
|
||||
- return false;
|
||||
- });
|
||||
-
|
||||
- //finished this routine
|
||||
- std::cout << "Disconnect, total: " << clientMap.size() << std::endl;
|
||||
-}
|
||||
-
|
||||
-void ServerApplication::HandleSynchronize(SerialPacket packet) {
|
||||
- //TODO: compensate for large distances
|
||||
-
|
||||
- //send all the server's data to this client
|
||||
- SerialPacket newPacket;
|
||||
- char buffer[PACKET_BUFFER_SIZE];
|
||||
-
|
||||
- //players
|
||||
- newPacket.meta.type = SerialPacket::Type::PLAYER_UPDATE;
|
||||
- for (auto& it : playerMap) {
|
||||
- //TODO: update this for the expanded PlayerEntry structure
|
||||
- newPacket.playerInfo.playerIndex = it.first;
|
||||
- snprintf(newPacket.playerInfo.handle, PACKET_STRING_SIZE, "%s", it.second.handle.c_str());
|
||||
- snprintf(newPacket.playerInfo.avatar, PACKET_STRING_SIZE, "%s", it.second.avatar.c_str());
|
||||
- newPacket.playerInfo.position = it.second.position;
|
||||
- newPacket.playerInfo.motion = it.second.motion;
|
||||
- serialize(&newPacket, buffer);
|
||||
- network.Send(&clientMap[packet.clientInfo.index].address, buffer, PACKET_BUFFER_SIZE);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-void ServerApplication::HandleShutdown(SerialPacket packet) {
|
||||
- //end the server
|
||||
- running = false;
|
||||
-
|
||||
- //disconnect all clients
|
||||
- packet.meta.type = SerialPacket::Type::DISCONNECT;
|
||||
- PumpPacket(packet);
|
||||
-
|
||||
- //finished this routine
|
||||
- std::cout << "Shutdown signal accepted" << std::endl;
|
||||
-}
|
||||
-
|
||||
-void ServerApplication::HandlePlayerNew(SerialPacket packet) {
|
||||
- //register the new PlayerEntry
|
||||
- //NOTE: assigning each field one-by-one so adding or moving a field doesn't break this code
|
||||
- PlayerEntry newPlayer;
|
||||
-
|
||||
- //metadata
|
||||
- newPlayer.clientIndex = packet.playerInfo.clientIndex;
|
||||
- newPlayer.handle = packet.playerInfo.handle;
|
||||
- newPlayer.avatar = packet.playerInfo.avatar;
|
||||
-
|
||||
- //position
|
||||
- newPlayer.mapIndex = 0;
|
||||
- newPlayer.position = {0,0};
|
||||
- newPlayer.motion = {0,0};
|
||||
- newPlayer.bbox = {0, 0, 0, 0};
|
||||
-
|
||||
- //TODO: Add the statistic creation code here
|
||||
-
|
||||
- //push this player
|
||||
- playerMap[PlayerEntry::uidCounter] = newPlayer;
|
||||
-
|
||||
- //send the client their info
|
||||
- packet.playerInfo.playerIndex = PlayerEntry::uidCounter;
|
||||
- packet.playerInfo.position = newPlayer.position;
|
||||
- packet.playerInfo.motion = newPlayer.motion;
|
||||
-
|
||||
- //actually send to everyone
|
||||
- PumpPacket(packet);
|
||||
-
|
||||
- //finish this routine
|
||||
- PlayerEntry::uidCounter++;
|
||||
-}
|
||||
-
|
||||
-//TODO: differentiate between delete and unload
|
||||
-void ServerApplication::HandlePlayerDelete(SerialPacket packet) {
|
||||
- //TODO: authenticate who is deleting this player
|
||||
- if (playerMap.find(packet.playerInfo.playerIndex) == playerMap.end()) {
|
||||
- throw(std::runtime_error("Cannot delete a non-existant player"));
|
||||
- }
|
||||
-
|
||||
- //TODO: remove the deleted player from the database?
|
||||
-
|
||||
- //prep the delete packet
|
||||
- SerialPacket delPacket;
|
||||
- delPacket.meta.type = SerialPacket::Type::PLAYER_DELETE;
|
||||
-
|
||||
- //delete the specified playerEntry
|
||||
- erase_if(playerMap, [&](std::pair<unsigned int, PlayerEntry> it) -> bool {
|
||||
- //find the specified PlayerEntry
|
||||
- if (it.first == packet.playerInfo.playerIndex) {
|
||||
- //send to all
|
||||
- delPacket.playerInfo.playerIndex = it.first;
|
||||
- PumpPacket(delPacket);
|
||||
-
|
||||
- //delete this player
|
||||
- return true;
|
||||
- }
|
||||
- //skip this player
|
||||
- return false;
|
||||
- });
|
||||
-}
|
||||
-
|
||||
-void ServerApplication::HandlePlayerUpdate(SerialPacket packet) {
|
||||
- if (playerMap.find(packet.playerInfo.playerIndex) == playerMap.end()) {
|
||||
- throw(std::runtime_error("Cannot update a non-existant player"));
|
||||
- }
|
||||
-
|
||||
- //TODO: the server needs it's own movement system too
|
||||
- playerMap[packet.playerInfo.playerIndex].position = packet.playerInfo.position;
|
||||
- playerMap[packet.playerInfo.playerIndex].motion = packet.playerInfo.motion;
|
||||
-
|
||||
- PumpPacket(packet);
|
||||
-}
|
||||
-
|
||||
-void ServerApplication::HandleRegionRequest(SerialPacket packet) {
|
||||
- char buffer[PACKET_BUFFER_SIZE];
|
||||
- packet.meta.type = SerialPacket::Type::REGION_CONTENT;
|
||||
- packet.regionInfo.region = regionPager.GetRegion(packet.regionInfo.x, packet.regionInfo.y);
|
||||
- serialize(&packet, buffer);
|
||||
- network.Send(&packet.meta.srcAddress, buffer, PACKET_BUFFER_SIZE);
|
||||
-}
|
||||
-
|
||||
-void ServerApplication::PumpPacket(SerialPacket packet) {
|
||||
- //NOTE: I don't really like this, but it'll do for now
|
||||
- char buffer[PACKET_BUFFER_SIZE];
|
||||
- serialize(&packet, buffer);
|
||||
- for (auto& it : clientMap) {
|
||||
- network.Send(&it.second.address, buffer, PACKET_BUFFER_SIZE);
|
||||
- }
|
||||
-}
|
||||
@@ -1,255 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<java version="1.7.0_21" class="java.beans.XMLDecoder">
|
||||
<object class="com.horstmann.violet.ClassDiagramGraph">
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode" id="ClassNode0">
|
||||
<void property="attributes">
|
||||
<void property="text">
|
||||
<string>room list
|
||||
client list --?</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="methods">
|
||||
<void property="text">
|
||||
<string>Constructor()
|
||||
Destructor()
|
||||
Init()
|
||||
Loop()
|
||||
Quit()
|
||||
SetRunning(bool)
|
||||
GetRunning()
|
||||
OpenRoom(args)
|
||||
CloseRoom(roomHandle)</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Server Application</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double0">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double0"/>
|
||||
<double>146.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double0"/>
|
||||
<double>52.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>146.0</double>
|
||||
<double>52.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode" id="ClassNode1">
|
||||
<void property="attributes">
|
||||
<void property="text">
|
||||
<string>arguments
|
||||
mailBox
|
||||
</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="methods">
|
||||
<void property="text">
|
||||
<string>Constructor(args)
|
||||
Destructor()
|
||||
Init()
|
||||
Loop()
|
||||
Quit()
|
||||
SetRunning(bool)
|
||||
GetRunning()
|
||||
GetMailBox()
|
||||
</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Base Room</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double1">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double1"/>
|
||||
<double>343.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double1"/>
|
||||
<double>49.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>343.0</double>
|
||||
<double>49.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode" id="ClassNode2">
|
||||
<void property="attributes">
|
||||
<void property="text">
|
||||
<string>input queue
|
||||
output queue
|
||||
input lock
|
||||
output lock</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="methods">
|
||||
<void property="text">
|
||||
<string>PushIn(arg)
|
||||
PeekIn()
|
||||
PopIn()
|
||||
PushOut(arg)
|
||||
PeekOut()
|
||||
PopOut()</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Mail Box</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double2">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double2"/>
|
||||
<double>489.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double2"/>
|
||||
<double>50.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>489.0</double>
|
||||
<double>50.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode" id="ClassNode3">
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Generic Room</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double3">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double3"/>
|
||||
<double>284.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double3"/>
|
||||
<double>299.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>284.0</double>
|
||||
<double>299.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode" id="ClassNode4">
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Combat Room</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double4">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double4"/>
|
||||
<double>419.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double4"/>
|
||||
<double>300.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>419.0</double>
|
||||
<double>300.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="connect">
|
||||
<object class="com.horstmann.violet.ClassRelationshipEdge">
|
||||
<void property="bentStyle">
|
||||
<object class="com.horstmann.violet.BentStyle" field="HVH"/>
|
||||
</void>
|
||||
<void property="startArrowHead">
|
||||
<object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
|
||||
</void>
|
||||
</object>
|
||||
<object idref="ClassNode0"/>
|
||||
<object idref="ClassNode1"/>
|
||||
</void>
|
||||
<void method="connect">
|
||||
<object class="com.horstmann.violet.ClassRelationshipEdge">
|
||||
<void property="bentStyle">
|
||||
<object class="com.horstmann.violet.BentStyle" field="HVH"/>
|
||||
</void>
|
||||
<void property="startArrowHead">
|
||||
<object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
|
||||
</void>
|
||||
</object>
|
||||
<object idref="ClassNode1"/>
|
||||
<object idref="ClassNode2"/>
|
||||
</void>
|
||||
<void method="connect">
|
||||
<object class="com.horstmann.violet.ClassRelationshipEdge">
|
||||
<void property="bentStyle">
|
||||
<object class="com.horstmann.violet.BentStyle" field="VHV"/>
|
||||
</void>
|
||||
<void property="endArrowHead">
|
||||
<object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
|
||||
</void>
|
||||
</object>
|
||||
<object idref="ClassNode3"/>
|
||||
<object idref="ClassNode1"/>
|
||||
</void>
|
||||
<void method="connect">
|
||||
<object class="com.horstmann.violet.ClassRelationshipEdge">
|
||||
<void property="bentStyle">
|
||||
<object class="com.horstmann.violet.BentStyle" field="VHV"/>
|
||||
</void>
|
||||
<void property="endArrowHead">
|
||||
<object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
|
||||
</void>
|
||||
</object>
|
||||
<object idref="ClassNode4"/>
|
||||
<object idref="ClassNode1"/>
|
||||
</void>
|
||||
</object>
|
||||
</java>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,413 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<java version="1.7.0_25" class="java.beans.XMLDecoder">
|
||||
<object class="com.horstmann.violet.ClassDiagramGraph">
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode" id="ClassNode0">
|
||||
<void property="methods">
|
||||
<void property="text">
|
||||
<string>Init(argc, argv)
|
||||
Loop()
|
||||
Quit()</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Server Application</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double0">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double0"/>
|
||||
<double>734.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double0"/>
|
||||
<double>45.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>734.0</double>
|
||||
<double>45.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode" id="ClassNode1">
|
||||
<void property="attributes">
|
||||
<void property="text">
|
||||
<string>index
|
||||
address</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Client Entry</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double1">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double1"/>
|
||||
<double>733.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double1"/>
|
||||
<double>192.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>733.0</double>
|
||||
<double>192.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode" id="ClassNode2">
|
||||
<void property="attributes">
|
||||
<void property="text">
|
||||
<string>index
|
||||
thread*
|
||||
room*</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Room Handle</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double2">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double2"/>
|
||||
<double>1013.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double2"/>
|
||||
<double>187.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>1013.0</double>
|
||||
<double>187.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode" id="ClassNode3">
|
||||
<void property="attributes">
|
||||
<void property="text">
|
||||
<string>room list</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="methods">
|
||||
<void property="text">
|
||||
<string>OpenRoom(...)
|
||||
GetRoom(...)
|
||||
CloseRoom(...)</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Room Manager</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double3">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double3"/>
|
||||
<double>1006.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double3"/>
|
||||
<double>55.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>1006.0</double>
|
||||
<double>55.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode">
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Player Manager</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double4">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double4"/>
|
||||
<double>481.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double4"/>
|
||||
<double>502.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>481.0</double>
|
||||
<double>502.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode">
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Account Manager</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double5">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double5"/>
|
||||
<double>484.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double5"/>
|
||||
<double>620.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>484.0</double>
|
||||
<double>620.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode" id="ClassNode4">
|
||||
<void property="attributes">
|
||||
<void property="text">
|
||||
<string>player list
|
||||
map...
|
||||
</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="methods">
|
||||
<void property="text">
|
||||
<string>Init()
|
||||
Loop()
|
||||
Quit()
|
||||
AddPlayer(...)
|
||||
RemovePlayer(...)
|
||||
HandleConnection(...)
|
||||
HandleDisconnection(...)</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>World Room</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double6">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double6"/>
|
||||
<double>982.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double6"/>
|
||||
<double>333.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>982.0</double>
|
||||
<double>333.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode" id="ClassNode5">
|
||||
<void property="attributes">
|
||||
<void property="text">
|
||||
<string>monster list
|
||||
player list
|
||||
accesses statistics of players
|
||||
calculates all combat...</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="methods">
|
||||
<void property="text">
|
||||
<string>Init()
|
||||
Loop()
|
||||
Quit()</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Combat Room</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double7">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double7"/>
|
||||
<double>974.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double7"/>
|
||||
<double>599.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>974.0</double>
|
||||
<double>599.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.PackageNode">
|
||||
<void property="contents">
|
||||
<void property="text">
|
||||
<string>account information
|
||||
player characters
|
||||
item information</string>
|
||||
</void>
|
||||
</void>
|
||||
<void property="name">
|
||||
<string>SQLite 3</string>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double8">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double8"/>
|
||||
<double>422.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double8"/>
|
||||
<double>90.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>422.0</double>
|
||||
<double>90.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="addNode">
|
||||
<object class="com.horstmann.violet.ClassNode">
|
||||
<void property="name">
|
||||
<void property="text">
|
||||
<string>Client Manager</string>
|
||||
</void>
|
||||
</void>
|
||||
</object>
|
||||
<object class="java.awt.geom.Point2D$Double" id="Point2D$Double9">
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>x</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double9"/>
|
||||
<double>486.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void class="java.awt.geom.Point2D$Double" method="getField">
|
||||
<string>y</string>
|
||||
<void method="set">
|
||||
<object idref="Point2D$Double9"/>
|
||||
<double>239.0</double>
|
||||
</void>
|
||||
</void>
|
||||
<void method="setLocation">
|
||||
<double>486.0</double>
|
||||
<double>239.0</double>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="connect">
|
||||
<object class="com.horstmann.violet.ClassRelationshipEdge">
|
||||
<void property="bentStyle">
|
||||
<object class="com.horstmann.violet.BentStyle" field="HVH"/>
|
||||
</void>
|
||||
<void property="startArrowHead">
|
||||
<object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
|
||||
</void>
|
||||
</object>
|
||||
<object idref="ClassNode0"/>
|
||||
<object idref="ClassNode1"/>
|
||||
</void>
|
||||
<void method="connect">
|
||||
<object class="com.horstmann.violet.ClassRelationshipEdge">
|
||||
<void property="bentStyle">
|
||||
<object class="com.horstmann.violet.BentStyle" field="HVH"/>
|
||||
</void>
|
||||
<void property="startArrowHead">
|
||||
<object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
|
||||
</void>
|
||||
</object>
|
||||
<object idref="ClassNode3"/>
|
||||
<object idref="ClassNode2"/>
|
||||
</void>
|
||||
<void method="connect">
|
||||
<object class="com.horstmann.violet.ClassRelationshipEdge">
|
||||
<void property="bentStyle">
|
||||
<object class="com.horstmann.violet.BentStyle" field="HVH"/>
|
||||
</void>
|
||||
<void property="startArrowHead">
|
||||
<object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
|
||||
</void>
|
||||
</object>
|
||||
<object idref="ClassNode4"/>
|
||||
<object idref="ClassNode5"/>
|
||||
</void>
|
||||
<void method="connect">
|
||||
<object class="com.horstmann.violet.ClassRelationshipEdge">
|
||||
<void property="bentStyle">
|
||||
<object class="com.horstmann.violet.BentStyle" field="HVH"/>
|
||||
</void>
|
||||
<void property="startArrowHead">
|
||||
<object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
|
||||
</void>
|
||||
</object>
|
||||
<object idref="ClassNode2"/>
|
||||
<object idref="ClassNode4"/>
|
||||
</void>
|
||||
</object>
|
||||
</java>
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user