Commit graph

93 commits

Author SHA1 Message Date
Scionwest_cp
7c6ca6a2b9 MudEngine:
- Fixed command engine stalling when waiting for one users command to finish before starting another users command.
 - Commands are loaded into static List collections, but the Execute command itself is now no longer static.
 - Player.CommandSystem property added so each player has their own commandengine to process their input.
2010-08-01 20:50:21 -07:00
u8sand_cp
b3a672503f Few Fixes
- Receives junk sent by telnet client upon established connection
- Fixed up some problems with ReadInput
- Fixed up Disconnect
- Replaced some Log() calls.
- Commented out Initialize on a new thread, will be uncommented when CommandEngine is fixed.
- CommandEngine doesn't want to do things while other things are happening even though they are on different threads... Fix that?
2010-08-01 20:07:29 -07:00
Scionwest_cp
bc05eba56e MudEngine:
- Some minor changes to removal of unwanted characters in commands.
2010-08-01 19:26:26 -07:00
Scionwest_cp
29cdae3b1a MudEngine:
- Corrected CommandLogin to support the Player.Send/Receive methods.
 - Re-organized the Game class source code and added additional commenting.
 - Began adding code to remove un-wanted characters in the received byte stream in Player.Receive()
2010-08-01 17:34:59 -07:00
u8sand_cp
942b038b1b - Added ReadInput() Method, returns string of what is sent to server.
- Send method receives a string and sends the data
- Receive method receives a string instead of bytes now.
- Server simply uses ReadInput method.
2010-08-01 10:49:31 -07:00
Scionwest_cp
607bd673a5 MudEngine:
- Sending messages to the client from the server is now an added feature. Use Game.SendMessage()
 - Added Load and Save commands for players.
 - Added Missing SaveDataPaths struct file.
2010-07-30 19:31:49 -07:00
Scionwest_cp
4be5a831b1 MudEngine:
- BaseObject Saving and Loading fully implemented.
 - BaseCharacter Saving and Loading fully implemented.
 - Game.cs now contains SaveDataPaths property for allowing users to define where their data will be saved.
 -
2010-07-30 19:02:05 -07:00
u8sand_cp
7f39821216 - Fixed server
- Works for multiplayer now, exit doesn't shut down everything.
- Less memory usage.
- TODO: If startup message, handle it.
2010-07-30 16:41:54 -07:00
Scionwest_cp
e822537128 MudEngine:
- BaseObject save code re-wrote
 - Added Inventory property to BaseCharacter 
 - BaseCharacter Save() now called when players are being disconnected.
 - Adjusted how objects Filenames are generated.
2010-07-30 15:50:53 -07:00
Scionwest_cp
2152a139b0 MudEngine:
- Reverted Server code back to using player arrays rather than List<> so that the server will actually start and run again.
2010-07-29 19:07:09 -07:00
Scionwest_cp
9b023a2092 MudCompiler:
- Updated to work with ScriptingEngine changes.

MudEngine:
 - Game.PlayerCollection changed to a List<>. Server obtains a array version of it within Server.initialize() via players = pbs.ToArray().
 - All BaseObject classes now require a reference to the Game and contain a property called ActiveGame.
 - Player.Game removed and now uses it's parent objects ActiveGame property.
 - Player.Role property added. Uses the new SecurityRoles enum that specifies what level of access the player has.
 - ScriptEngine now loads all libraries found within the specified ScriptsPath directory, instances the scripts and places them into a collection.
 - Custom character script instancing is now supported, but not fully implemented throughout the engine. They can be loaded, but not used during runtime at this time.
2010-07-29 17:39:38 -07:00
u8sand_cp
631ce62e73 - Server instead of receiving 255 bytes, receives 1 byte at a time. When no more data is received it sends to the player. More efficient, less memory usage, no possibility of data cutoff. 2010-07-29 07:54:50 -07:00
Scionwest_cp
23e5efb58e MudServer:
- Began working on in-line commands.

MudEngine:
 - Now logs when a player connects. MudServer prints this to the console via Log.GetMessages()

MudCompiler:
 - Added /bin/debug to ignore list.
2010-07-27 17:16:58 -07:00
Scionwest_cp
793c3cf1e9 MudEngine:
- FileManager.GetDataPath now returns the actual Root directory when Root is requested rather than Root/Projects. That was considered Root for the older Designer.
 - CommandEngine.GetCommands is now a method rather than a property.
 - CommandEngine.LoadAllCommands replaced with CommandEngine.LoadBaseCommands for loading Engine specific Game commands. This is called from within Game.Start. A possible property for disabling default commands could be looked at in the future.
 - CommandEngine.LoadCommandLibrary method added for loading custom user commands. This is fully implemented.
 - CommandEngine.ClearCommands method added for clearing all currently loaded commands.
 - Game.IsDebug static property added.
 - Added additional logging for testing purposes throughout the project. Changing Game.IsDebug to false will remove the majority of the logged messages.
 - Game.IsMultiplayer property added for enabling or disabling the server for Online/Offline support. Fully implemented.
 - Game no longer loads user script libraries as this was being handled already by ScriptEngine.Initialize()
 - Log now caches messages so consoles can print only content that was logged since the last loop. Using Log.FlushMessages() will clear the cached messages allowing each loop to show only the new logged messages.
 - BaseCharacter IsAdmin argument in the constructor has been removed. No longer needed for testing.
 - ScriptEngine can now compile more than 1 script without error.
 - ScriptEngine.Assembly property added for accessing the currently loaded script library. This should be a List<Assembly> in the future for multiple libraries.
 - Removed the last of my BlitScript engine code from ScriptEngine.cs as it was XNA specific. Need to look at StartupObject.cs as I believe that is XNA specific as well and not needed.

MudGame:
 - Renamed MudGame to MudOfflineExample as it will be used for testing the game with Game.IsMultiplayer disabled. Makes testing easier then needing to stop/restart the server and connect via telnet constantly.

MudServer:
 - Added MudServer project. This is a dedicated server that runs with Game.IsMultiplayer enabled. Developers can connect to it via telnet clients. All engine game commands are implemented.
 - MudServer includes bin/Debug/Scripts.dll, which is a compiled library of scripts generated via MudCompiler. MudEngine.Game handles loading the library and there is no additional code required by the developers to implement their libraries into their games provided the name is 'Scripts.dll'
2010-07-27 16:31:50 -07:00
u8sand_cp
281fe4b320 - Complete networking aspect
- only TCP, works has been tested
- Commented out Lists and replaced with arrays, the way the list was working it wouldn't have worked, if you can figure out how to make it work feel free to fix it up.
- TODO: When user types exit, the game object becomes useless, I need a Reset function of some kind to reset it for when a new player comes in to reuse that player object.
- TODO: Encryption
- TODO: Fix main person so they have admin commands like list, restart instead of a game with the main server. (ATM Just like that for testing, but now you can test with telnet client)
2010-07-26 18:45:21 -07:00
Scionwest_cp
c965d5e97a MudEngine:
- Fixed BaseCharacter not returning content to the game loop
 - Fixed Zone.LinkRooms linking rooms backwards.

MudGame:
 - Minor tweaks to the BuildRealms method
 - Minor tweaks to the Program.Main method.
2010-07-25 22:29:24 -07:00
Scionwest_cp
e145d57682 MudEngine:
- Rooms can now be linked automatically via the new Zone.LinkRooms method. Room linking can no longer be done manually as the Doorways property is now read-only.
 - Door.Description has been removed. Doorway description will need to be included in Room.Description or Room.DetailedDescription properties.
 - Added DetailedDescription to make creating multi-line descriptions easier. Not supported by the Look command yet.
 - Game.IsRunning is now read-only. The Game will manage this property on its own.
 - BaseCharacter.ExecuteCommand now will always return a string. Simplifying the game loop for users as they no longer need to check what Type was returned by the command.
 - Doors now contain a DepartureRoom and a ArrivalRoom property allowing for easy access to Rooms that are linked together.
 - Fixed a bug where Game, Realms and Zones always assigned IsInitial to Realms, Zones and Rooms when added to the collections. Collection would contain multiple IsInitial objects.
 - Removed Room.InstalledDoorways property as that was used only by the old Designer
 - Removed Room.Load() as that implementation of it is obsolete.

MudGame:
 - Revised Zeroth to build it's Zone and Rooms using the new Zone.LinkRooms function.
 - Greatly revised Program.cs and the Game loop to take advantage of many of the automations provided by the Engine now.
2010-07-25 20:50:39 -07:00
Scionwest_cp
7e3cf1eb0c MudEngine:
- Walk Command tweaks
 - BaseCharacter now defaults to IsAdmin=true for testing purposes.
2010-07-25 18:44:19 -07:00
Scionwest_cp
70533582a6 MudEngine:
- Player movement command now fully implemented. 
 - Game.GetRealm() added to retrieve a Realm within the games RealmCollection property
 - Game.End() added to perform game ending duties and shut down the Server
 - Server now loses opened threads.
 - Player.Move() added to move the player from Room to Room.
 - Room.DoorwayExist() tweaked to work with the new way Environments are managed.

MudGame:
 - Now executes the Look command on startup so the player can see where they are located at.
 - Implements the new Game.End() method and fixes the game hanging upon exit.
2010-07-25 18:33:21 -07:00
Scionwest_cp
da42864a85 MudEngine:
- Fixed Game looking for a class inheriting from PlayerBasic instead of BaseCharacter during Script loading.

MudGame:
 - Added better commenting.
2010-07-25 17:05:31 -07:00
Scionwest_cp
486efa4fed MudEngine:
- Re-worked the command system. All commands now only need 2 arguments rather than 4. The actual command string and the Player
 - All commands updated to work with the new command system
 - Look command now works in the example MudGame 
 - Realm now contains InitialZone for the starting Zone within that Realm.
 - Zone now contains InitialRoom for the starting Room within that Zone.
 - All Environment objects now contains a Initial property and Add() method for adding child objects.
 - BaseCharacter now contains a copy of Game
 - Revised Realm.GetZone()
 - Revised Zone.GetRoom()
 - Removed Zone.RebuildRoomCollection as content is currently no longer stored using physical files.
 - Added GameManagement.Log for logging errors and warnings to file. Use Log.Write().
2010-07-25 16:56:15 -07:00
Scionwest_cp
0587b4a475 MudEngine:
- Deleted GameObjects.Characters.Controlled and GameObjects.Characters.NPC namespaces.
 - Deleted PlayerBasic & PlayerAdmin classes.
 - BaseCharacter now contains IsAdmin property for providing admin privileges to users.
 - BaseCharacter now contains IsControlled property for setting user control or AI controlled
 - Added startup.dat - This will supply information to the engine as to what Types will be used during runtime. Allowing for custom Types via scripts to be instanced and used (such as a custom player class rather than the default one).
2010-07-25 11:04:32 -07:00
Scionwest_cp
dbe1e693e5 MudEngine:
- Changed Player[] array to a List<> Collection of PlayerBasics. This change is reflected across all Types.
 - Game now contains a Start() function. StartServer is now called from within here.
 - Game now has partial support for the Script Engine

MudGame:
 - Game.StartServer has changed to Game.Start(). StartServer is called within Start().
2010-07-24 10:33:27 -07:00
Scionwest_cp
0f87ac233a MUDCompiler:
- Now compiles scripts contained under a MUDCompiler/bin/debug/Scripts folder.

MudEngine:
 - ScriptEngine now wraps scripts inside a default namespace. MUDScripts MUST not be placed within a namespace inside the script. The Engine handles it automatically.
2010-07-23 17:22:25 -07:00
Scionwest_cp
fe05693fee MudEngine:
- Fixed ClientSocket accessor error.

MudCompiler:
 - Added new project. This will compile the game scripts along with performing object checks to ensure the game contains no errors prior to publishing a release of the game.
2010-07-23 15:46:44 -07:00
u8sand_cp
49c581840a - Tcp Server functionality 2010-07-22 20:13:55 -07:00
Scionwest_cp
f7756e2032 MudEngine:
- Added missing PlayerAdmin class.
2010-07-22 18:01:40 -07:00
Scionwest_cp
e9e3bb8033 MudEngine:
- Created PlayerAdmin class. All admins will be instances of this class; allows for segregating admin code into a different class for easier management and maintenance.
 - CommandRestart now checks to make sure the player is of Type PlayerAdmin instead of player.admin
 - Added ExecuteCommand to BaseCharacter. All Characters (NPC & Players) can execute commands now. Allows for AI to roam the world at some point in the future by invoking the available move commands.

MUDGame:
 - Updated the command execution from CommandEngine.Execute to user.ExecuteCommand to use the BaseCharacter version.
 - Changed PlayerBasic to PlayerAdmin for testing purposes.

TODO: Remove command execution from game loop, server should sit and wait for telnet data to be transmitted to it within the loop. That will be the command and passed off to the BaseCharacter/Player/NPC ect ExecuteCommand
2010-07-22 16:18:53 -07:00
u8sand_cp
1baa067044 - Added player array in game
- put server in Game
- created start server function in Game
- created CommandRestart

There are two different 'player classes' which do I use? PlayerBasic and BasePlayer.
2010-07-21 09:32:27 -07:00
u8sand_cp
15de95ba65 - Added Server class, basically finished.
- Server start method starts server's own thread
- Both tcp and udp support.
Needed:
- Connection to the MudEngine
- Finish coding serverThread
2010-07-19 15:35:05 -07:00
u8sand_cp
a26280b711 - Much work on the networking
- ServerSocket done.
- ClientSocket done.
- Few fixes required:
   - Warning in ServerSocket
   - Friends possible in C#?
2010-07-19 07:09:34 -07:00
Scionwest_cp
6987d8178f MudEngine:
- Added Look and Walk Commands, however they are not fully implemented.
 - Corrected Networking classes having a public de-constructor. These must be private or the compiler fails.
 - Corrected Networking classes using an incorrect 'using' statement. You cannot reference classes in the statement, must only reference the namespace itself (i.e. using MUDEngine.Networking).
 - Removed using statement for Networking in the Networking classes as all classes created within that namespace automatically are within the same scope.
2010-07-18 21:25:12 -07:00
u8sand_cp
ce94e8d3f8 Sigh, I'm probably spamming the board now. Who woulda known commit wouldn't commit something up_one_level. 2010-07-18 20:32:46 -07:00
u8sand_cp
8381349143 Wups, forgot to "add" this. 2010-07-18 20:31:30 -07:00
u8sand_cp
27a1f617b8 Networking Continued, template classes finished. Next I'll add actual functionality. 2010-07-18 20:30:57 -07:00
u8sand_cp
3227210590 Networking Finally starting to be added :D 2010-07-18 19:53:05 -07:00
Scionwest_cp
ba95d6b070 MudEngine:
- GameObject.GetProperty now supports returning Dynamic Types (Requires .NET 4.0)
2010-07-18 14:41:04 -07:00
Scionwest_cp
6282478c9f Migrated entire project to Visual C# Express 2010 and .NET Framework 4.0
Any users using the source code will need to use the aforementioned products from now on.
2010-07-18 14:36:26 -07:00
Scionwest_cp
b8f6be12c0 Mud Designer:
- Removed from solution

Mud Engine:
 - Moved the CommandEngine, CommandResults and ICommand Interface out from the Commands namespace and into GameManagement since they manage the game commands.
 - Added CommandExit class to provide the ability to exit a game once running. This is fully implemented.
 - Realms, Zones and Rooms now have an IsInitial property for determining if this is an initial location for the Game.
 - Renamed GameSetup to Game.
 - Corrected GameObject being in the incorrect namespace.
 - Corrected the ScriptEngine not 
 - CommandEngine no longer needs a Name argument. Arguments changed from 5 to 4 due to this change.

Mud Game:
 - Added Example Game used for testing various MUDEngine features and testing constructability of games using the engine.
 - Currently only contains 1 Realm, 1 Zone and Two Rooms. Only working command is Exit.
2010-07-18 13:52:16 -07:00
Scionwest_cp
06266b7245 MudEngine:
- Minor tweaks to Room.cs for checking file extension validity
 - Scripting Engine and related classes added to Solution (Files existed but were not a part of solution)
2010-07-17 09:55:43 -07:00
Scionwest_cp
35c10eed68 MudEngine:
- Implemented Scripting Engine; Not fully completed
 - Migrated PlayerBasic from MudDesigner to MudEngine.
2010-07-16 15:35:10 -07:00
Scionwest_cp
d40b8690d5 - Migrated additional content from MudDesigner solution to MudEngine.
- Updated MudDesigner to reference the new MudEngine solution.
- MudDesigner currently references engine classes within it's own solution and the MudEngine solution. This will be addressed soon. All classes related to the engine will be moved to the MudEngine project.
- Began prepping for the removal of all UITypeEditor classes and the namespace from the MudDesigner project.

Please note that while this version will compile, it is currently broken. Projects do not get created correctly due to the migration I'm performing. The designer is given less priority at the moment as the engine is the primary focus. Projects will need to be hard-coded using the MudEngine library until the designer is fixed.
2010-07-15 20:21:56 -07:00
Scionwest_cp
dc311f5aa5 Added MudEngine Project to the Solution. I will slowly be moving the MudDesigner.MudEngine classes out of the Mud Designer Solution and into it's own.
Currently the Mud Designer still contains the old MudEngine classes until migration has been completed.
2010-07-15 18:53:38 -07:00