-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
("Optionally") remove all Monocle and Celeste references from Server …
…& Shared (#154) * check the description of the PR ( #154) if anything is unclear about this squash'd merge.
- Loading branch information
Showing
25 changed files
with
545 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Xml.Serialization; | ||
|
||
namespace Celeste.Mod.CelesteNet { | ||
|
||
[Serializable] | ||
public class CelesteAudioState { | ||
|
||
// NOTE: If there are things missing from this that are needed Server-side (or in Shared), | ||
// check Celeste.AudioState and Everest/Celeste.Mod.mm/Patches/AudioState.cs to add it here | ||
|
||
public static string[] LayerParameters = new string[10] { "layer0", "layer1", "layer2", "layer3", "layer4", "layer5", "layer6", "layer7", "layer8", "layer9" }; | ||
|
||
public CelesteAudioTrackState Music = new CelesteAudioTrackState(); | ||
|
||
public CelesteAudioTrackState Ambience = new CelesteAudioTrackState(); | ||
|
||
public float? AmbienceVolume; | ||
|
||
public CelesteAudioState() { | ||
} | ||
|
||
public CelesteAudioState(CelesteAudioTrackState music, CelesteAudioTrackState ambience) { | ||
if (music != null) { | ||
Music = music.Clone(); | ||
} | ||
|
||
if (ambience != null) { | ||
Ambience = ambience.Clone(); | ||
} | ||
} | ||
} | ||
|
||
[Serializable] | ||
public class CelesteAudioTrackState { | ||
|
||
// NOTE: If there are things missing from this that are needed Server-side (or in Shared), | ||
// check Celeste.AudioTrackState and potentially an Everest patch (currently there is none) | ||
|
||
[XmlIgnore] | ||
private string ev; | ||
|
||
public List<CelesteMEP> Parameters = new List<CelesteMEP>(); | ||
|
||
[XmlAttribute] | ||
public string Event { | ||
get { | ||
return ev; | ||
} | ||
set { | ||
if (ev != value) { | ||
ev = value; | ||
Parameters.Clear(); | ||
} | ||
} | ||
} | ||
|
||
[XmlIgnore] | ||
public int Progress { | ||
get { | ||
return (int)GetParam("progress"); | ||
} | ||
set { | ||
Param("progress", value); | ||
} | ||
} | ||
|
||
public CelesteAudioTrackState() { | ||
} | ||
|
||
public CelesteAudioTrackState(string ev) { | ||
Event = ev; | ||
} | ||
|
||
public CelesteAudioTrackState Param(string key, float value) { | ||
foreach (CelesteMEP parameter in Parameters) { | ||
if (parameter.Key != null && parameter.Key.Equals(key, StringComparison.InvariantCultureIgnoreCase)) { | ||
parameter.Value = value; | ||
return this; | ||
} | ||
} | ||
|
||
Parameters.Add(new CelesteMEP(key, value)); | ||
return this; | ||
} | ||
|
||
public float GetParam(string key) { | ||
foreach (CelesteMEP parameter in Parameters) { | ||
if (parameter.Key != null && parameter.Key.Equals(key, StringComparison.InvariantCultureIgnoreCase)) { | ||
return parameter.Value; | ||
} | ||
} | ||
|
||
return 0f; | ||
} | ||
|
||
public CelesteAudioTrackState Clone() { | ||
CelesteAudioTrackState audioTrackState = new CelesteAudioTrackState(); | ||
audioTrackState.Event = Event; | ||
foreach (CelesteMEP parameter in Parameters) { | ||
audioTrackState.Parameters.Add(new CelesteMEP(parameter.Key, parameter.Value)); | ||
} | ||
|
||
return audioTrackState; | ||
} | ||
} | ||
|
||
[Serializable] | ||
public class CelesteMEP { | ||
[XmlAttribute] | ||
public string Key; | ||
|
||
[XmlAttribute] | ||
public float Value; | ||
|
||
public CelesteMEP() { | ||
} | ||
|
||
public CelesteMEP(string key, float value) { | ||
Key = key; | ||
Value = value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Xml.Serialization; | ||
|
||
namespace Celeste.Mod.CelesteNet { | ||
[Serializable] | ||
public struct CelesteEntityID { | ||
public static readonly CelesteEntityID None = new CelesteEntityID("null", -1); | ||
|
||
[XmlIgnore] | ||
public string Level; | ||
|
||
[XmlIgnore] | ||
public int ID; | ||
|
||
[XmlAttribute] | ||
public string Key { | ||
get { | ||
return Level + ":" + ID; | ||
} | ||
set { | ||
string[] array = value.Split(':'); | ||
Level = array[0]; | ||
ID = int.Parse(array[1]); | ||
} | ||
} | ||
|
||
public CelesteEntityID(string level, int entityID) { | ||
Level = level; | ||
ID = entityID; | ||
} | ||
|
||
public override string ToString() { | ||
return Key; | ||
} | ||
|
||
public override int GetHashCode() { | ||
return Level.GetHashCode() ^ ID; | ||
} | ||
} | ||
} |
Oops, something went wrong.