Browse Source

Added some more documentation on data/

Moved intro sequence into client and out of server (The intro sequence
is better placed in the client not the server at least until we get a
StateMachine going)
Steve Thielemann 7 months ago
parent
commit
ff08e4a9c4
3 changed files with 11 additions and 10 deletions
  1. 7 5
      .data_directory.txt
  2. 3 0
      client.go
  3. 1 5
      server.go

+ 7 - 5
.data_directory.txt

@@ -2,16 +2,18 @@
 
 F config.toml (Where server settings will live)
 F motd.txt (A text file to be sent out on login)
-D data/
-D data/logs
+D data/ (Global data directory)
+D data/logs (Logs, useful for making bug reports and helping fix bug reports)
 F data/logs/XX-XX-XXXX.log (Where X will be the date in MM-DD-YYYY format)
-D data/games
+D data/games (Where all the games will live)
 D data/games/gameX (Where X is game number)
 F data/games/gameX/config.toml (Where game specific settings will live)
+F data/games/gameX/motd.txt (A text file to be sent out once a player joins this game)
 F data/games/gameX/map.json (Mapping file, Lists ONLY sector and it's warps, no other data)
 F data/games/gameX/ships.json (Ship Models, so you could have a Death Star in one game, and a Battlestar in another, etc)
 D data/games/gameX/data (Where player data, sector data, ports and planets live)
 F data/games/gameX/data/players.db3 (sqlite database: id, name, password, sector, ship_id, corp_id)
-F data/games/gameX/data/corps.json (json file: corp_id, corp_name, corp_leader_id, corp_password, corp_motd)
+F data/games/gameX/data/corps.db3(sqlite database: id, name, leader_id, password, motd)
 F data/games/gameX/data/ships.db3 (sqlite database: id, name, model_id, owner_id, corp_owned, figs, shields, holds, cargo_contents)
-F data/games/gameX/data/sectors.db3 (sqlite database)
+F data/games/gameX/data/sectors.db3 (sqlite database: id, warps, beacon, navhaz, port_id, planets, deploy-ables)
+F data/games/gameX/data/planets.db3 (sqlite database: id, name, owner_id, corp_owned, figs, shields, citadel_lvl, population, etc)

+ 3 - 0
client.go

@@ -31,6 +31,9 @@ func NewClient(server *Server, conn net.Conn) *Client {
 	c.Write("\xff\xfb\x01\xff\xfb\x03\xff\xfd\x10")
 	Drain(c.conn, 3)
 	go c.reader()
+	c.Write("Login: ")
+	c.InsertWrite("Trade Trek\r\n")
+	c.InsertWrite("v1.0  Apollo@21:1/236\r\n\r\n")
 	return c
 }
 

+ 1 - 5
server.go

@@ -20,10 +20,6 @@ func (s *Server) Run() error {
 		if err != nil {
 			return err
 		}
-		c := NewClient(s, conn)
-		s.Conns = append(s.Conns, c)
-		c.Write("Login: ")
-		c.InsertWrite("Trade Trek\r\n")
-		c.InsertWrite("v1.0  Apollo@21:1/236\r\n\r\n")
+		s.Conns = append(s.Conns, NewClient(s, conn))
 	}
 }