Skip to content

Commit

Permalink
Merge pull request space-wizards#77 from psykzz/cleanup
Browse files Browse the repository at this point in the history
Cleanup whitespace and ChatChannel summaries
  • Loading branch information
ZoldorfTheWizard authored May 1, 2017
2 parents 1d52e62 + 11366c0 commit 9749ba9
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 45 deletions.
12 changes: 1 addition & 11 deletions SS14.Client/GameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ namespace SS14.Client
public class GameController
{


#region Fields

private IPlayerConfigurationManager _configurationManager;
Expand Down Expand Up @@ -61,14 +60,11 @@ public GameController()
_stateManager = IoCManager.Resolve<IStateManager>();
_userInterfaceManager = IoCManager.Resolve<IUserInterfaceManager>();



_stateManager.RequestStateChange<MainScreen> ();

FrameEventArgs _frameEvent;
EventArgs _frameEventArgs;
_clock = new SFML.System.Clock();


while (CluwneLib.IsRunning == true)
{
Expand Down Expand Up @@ -260,9 +256,7 @@ private void SetupCluwne()
uint displayHeight = _configurationManager.GetDisplayHeight();
bool isFullscreen = _configurationManager.GetFullscreen();
var refresh = _configurationManager.GetDisplayRefresh();




CluwneLib.Video.SetFullscreen(isFullscreen);
CluwneLib.Video.SetRefreshRate(refresh);
CluwneLib.Video.SetWindowSize(displayWidth, displayHeight);
Expand All @@ -289,14 +283,10 @@ private void SetupCluwne()
CluwneLib.Screen.MouseLeft += MouseLeft;
CluwneLib.Screen.TextEntered += TextEntered;



CluwneLib.Go();
IoCManager.Resolve<IKeyBindingManager>().Initialize();
}



#endregion

#endregion
Expand Down
61 changes: 36 additions & 25 deletions SS14.Server/SS14Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,32 +287,43 @@ public void ProcessPackets()

public void Update(float frameTime)
{
if (Runlevel == RunLevel.Game)
{
EntityManager.ComponentManager.Update(frameTime);
EntityManager.Update(frameTime);
var start = stopWatch.ElapsedTicks;
//((AtmosManager)IoCManager.Resolve<IAtmosManager>()).Update(frameTime);
var end = stopWatch.ElapsedTicks;
var atmosTime = (end - start) / (float)Stopwatch.Frequency * 1000;
IoCManager.Resolve<IRoundManager>().CurrentGameMode.Update();
IoCManager.Resolve<ICraftingManager>().Update();
GC.KeepAlive(atmosTime);
}
else if (Runlevel == RunLevel.Lobby)

switch (Runlevel)
{
TimeSpan countdown = _startAt.Subtract(DateTime.Now);
if (_lastAnnounced != countdown.Seconds)
{
_lastAnnounced = countdown.Seconds;
IoCManager.Resolve<IChatManager>().SendChatMessage(ChatChannel.Server,
"Starting in " + _lastAnnounced + " seconds...",
"", 0);
}
if (countdown.Seconds <= 0)
{
StartGame();
}
case RunLevel.Game:

EntityManager.ComponentManager.Update(frameTime);
EntityManager.Update(frameTime);
var start = stopWatch.ElapsedTicks;
//((AtmosManager)IoCManager.Resolve<IAtmosManager>()).Update(frameTime);
var end = stopWatch.ElapsedTicks;
var atmosTime = (end - start) / (float)Stopwatch.Frequency * 1000;
IoCManager.Resolve<IRoundManager>().CurrentGameMode.Update();
IoCManager.Resolve<ICraftingManager>().Update();
GC.KeepAlive(atmosTime);

break;

case RunLevel.Lobby:

TimeSpan countdown = _startAt.Subtract(DateTime.Now);
if (_lastAnnounced != countdown.Seconds)
{
_lastAnnounced = countdown.Seconds;
IoCManager.Resolve<IChatManager>().SendChatMessage(ChatChannel.Server,
"Starting in " + _lastAnnounced + " seconds...",
"", 0);
}
if (countdown.Seconds <= 0)
{
StartGame();
}

break;

default:
// Unknown game state
break;
}
LastUpdate = Time;
SendGameStateUpdate();
Expand Down
48 changes: 39 additions & 9 deletions SS14.Shared/ChatConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,45 @@
{
public enum ChatChannel
{
/// <summary>
/// Default, unspecified
/// </summary>
Default,
Lobby, // Players in the lobby chat on this channel.
Ingame, // This is local chat.
Server, // Messages from the server
Damage, // Damage messages
Player, // Messages that are sent by the player
Radio, // Radio messages
Emote, // Emotes
OOC, // Out-of-character channel
Visual, // Things the character can see
/// <summary>
/// Players in the lobby chat
/// </summary>
Lobby,
/// <summary>
/// Chat heard by players within earshot
/// </summary>
Ingame,
/// <summary>
/// Messages from the server
/// </summary>
Server,
/// <summary>
/// Damage messages
/// </summary>
Damage,
/// <summary>
/// Messages that are sent by the player directly
/// </summary>
Player,
/// <summary>
/// Radio messages
/// </summary>
Radio,
/// <summary>
/// Emotes
/// </summary>
Emote,
/// <summary>
/// Out-of-character channel
/// </summary>
OOC,
/// <summary>
/// Things the character can see
/// </summary>
Visual,
}
}

0 comments on commit 9749ba9

Please sign in to comment.