change skybox
This commit is contained in:
@@ -59,5 +59,45 @@ namespace RH_Engine
|
|||||||
Console.WriteLine(sb.ToString());
|
Console.WriteLine(sb.ToString());
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string SkyboxCommand(int time)
|
||||||
|
{
|
||||||
|
if (time < 0 || time > 24)
|
||||||
|
{
|
||||||
|
throw new Exception("The time must be between 0 and 24!");
|
||||||
|
}
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
StringWriter sw = new StringWriter(sb);
|
||||||
|
|
||||||
|
using (JsonWriter writer = new JsonTextWriter(sw))
|
||||||
|
{
|
||||||
|
writer.Formatting = Formatting.Indented;
|
||||||
|
|
||||||
|
writer.WriteStartObject();
|
||||||
|
writer.WritePropertyName("id");
|
||||||
|
writer.WriteValue("tunnel/send");
|
||||||
|
writer.WritePropertyName("data");
|
||||||
|
writer.WriteStartObject();
|
||||||
|
writer.WritePropertyName("dest");
|
||||||
|
writer.WriteValue(tunnelID);
|
||||||
|
writer.WritePropertyName("data");
|
||||||
|
writer.WriteStartObject();
|
||||||
|
writer.WritePropertyName("id");
|
||||||
|
writer.WriteValue("scene/skybox/settime");
|
||||||
|
writer.WritePropertyName("data");
|
||||||
|
writer.WriteStartObject();
|
||||||
|
writer.WritePropertyName("time");
|
||||||
|
writer.WriteValue(time);
|
||||||
|
writer.WriteEndObject();
|
||||||
|
writer.WriteEndObject();
|
||||||
|
writer.WriteEndObject();
|
||||||
|
writer.WriteEndObject();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine(sb.ToString());
|
||||||
|
return sb.ToString();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ namespace RH_Engine
|
|||||||
private static PC[] PCs = {
|
private static PC[] PCs = {
|
||||||
new PC("DESKTOP-M2CIH87", "Fabian"),
|
new PC("DESKTOP-M2CIH87", "Fabian"),
|
||||||
new PC("T470S", "Shinichi"),
|
new PC("T470S", "Shinichi"),
|
||||||
new PC("NA", "Sem"),
|
new PC("DESKTOP-DHS478C", "Sem"),
|
||||||
new PC("NA", "Wouter"),
|
new PC("DESKTOP-TV73FKO", "Wouter"),
|
||||||
new PC("NA", "Ralf"),
|
new PC("NA", "Ralf"),
|
||||||
new PC("NA", "Bart") };
|
new PC("NA", "Bart") };
|
||||||
private static void Main(string[] args)
|
private static void Main(string[] args)
|
||||||
@@ -36,7 +36,7 @@ namespace RH_Engine
|
|||||||
|
|
||||||
stream.Write(res);
|
stream.Write(res);
|
||||||
|
|
||||||
//Console.WriteLine("sent message " + message);
|
Console.WriteLine("sent message " + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string ReadPrefMessage(NetworkStream stream)
|
public static string ReadPrefMessage(NetworkStream stream)
|
||||||
@@ -44,6 +44,7 @@ namespace RH_Engine
|
|||||||
byte[] lengthBytes = new byte[4];
|
byte[] lengthBytes = new byte[4];
|
||||||
|
|
||||||
stream.Read(lengthBytes, 0, 4);
|
stream.Read(lengthBytes, 0, 4);
|
||||||
|
Console.WriteLine("read message..");
|
||||||
|
|
||||||
int length = BitConverter.ToInt32(lengthBytes);
|
int length = BitConverter.ToInt32(lengthBytes);
|
||||||
|
|
||||||
@@ -77,9 +78,14 @@ namespace RH_Engine
|
|||||||
Console.WriteLine(tunnelResponse);
|
Console.WriteLine(tunnelResponse);
|
||||||
|
|
||||||
string tunnelID = JSONParser.GetTunnelID(tunnelResponse);
|
string tunnelID = JSONParser.GetTunnelID(tunnelResponse);
|
||||||
|
if (tunnelID == null)
|
||||||
|
{
|
||||||
|
Console.WriteLine("could not find a valid tunnel id!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
CreateGraphics createGraphics = new CreateGraphics(tunnelID);
|
CreateGraphics createGraphics = new CreateGraphics(tunnelID);
|
||||||
string command = createGraphics.TerrainCommand();
|
string command = createGraphics.SkyboxCommand(2);
|
||||||
|
|
||||||
|
|
||||||
Console.WriteLine("tunnelID is: " + tunnelID);
|
Console.WriteLine("tunnelID is: " + tunnelID);
|
||||||
|
|||||||
Reference in New Issue
Block a user