Changeset 436


Ignore:
Timestamp:
May 18, 2023, 3:09:12 PM (18 months ago)
Author:
alloc
Message:

Added Bloodmoon API
Removed WebUiUpdates API

Location:
binary-improvements2
Files:
1 added
1 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements2/WebServer/ModInfo.xml

    r435 r436  
    55        <Description value="Integrated Webserver for the Web Dashboard and server APIs" />
    66        <Author value="The Fun Pimps LLC" />
    7         <Version value="21.0.289.0" />
     7        <Version value="21.0.289.1" />
    88        <Website value="" />
    99</xml>
  • binary-improvements2/WebServer/WebServer.csproj

    r434 r436  
    120120    <Compile Include="src\WebAPI\AbsRestApi.cs" />
    121121    <Compile Include="src\WebAPI\AbsWebAPI.cs" />
     122    <Compile Include="src\WebAPI\APIs\Bloodmoon.cs" />
    122123    <Compile Include="src\WebAPI\APIs\Command.cs" />
    123124    <Compile Include="src\WebAPI\APIs\GameData\Item.cs" />
     
    135136    <Compile Include="src\WebAPI\APIs\ServerInfo.cs" />
    136137    <Compile Include="src\WebAPI\APIs\ServerStats.cs" />
    137     <Compile Include="src\WebAPI\APIs\WebUiUpdates.cs" />
    138138    <Compile Include="src\WebAPI\APIs\WorldState\Animal.cs" />
    139139    <Compile Include="src\WebAPI\APIs\WorldState\GetLandClaims.cs" />
  • binary-improvements2/WebServer/src/WebAPI/APIs/ServerStats.cs

    r426 r436  
    1212                private static readonly byte[] jsonKeyAnimals = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("animals");
    1313               
    14                 private static readonly byte[] jsonKeyDays = JsonWriter.GetEncodedPropertyNameWithBeginObject ("days");
    15                 private static readonly byte[] jsonKeyHours = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("hours");
    16                 private static readonly byte[] jsonKeyMinutes = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("minutes");
    1714
    1815                protected override void HandleRestGet (RequestContext _context) {
     
    2017                       
    2118                        writer.WriteRaw (jsonKeyGameTime);
    22 
    2319                        (int days, int hours, int minutes) = GameUtils.WorldTimeToElements (GameManager.Instance.World.worldTime);
    24                        
    25                         writer.WriteRaw (jsonKeyDays);
    26                         writer.WriteInt32 (days);
    27                        
    28                         writer.WriteRaw (jsonKeyHours);
    29                         writer.WriteInt32 (hours);
    30                        
    31                         writer.WriteRaw (jsonKeyMinutes);
    32                         writer.WriteInt32 (minutes);
    33                        
    34                         writer.WriteEndObject ();
     20                        JsonCommons.WriteGameTimeObject (ref writer, days, hours, minutes);
    3521
    3622                        writer.WriteRaw (jsonKeyPlayers);
  • binary-improvements2/WebServer/src/WebAPI/JsonCommons.cs

    r434 r436  
    3333                        _writer.WriteRaw (jsonKeyPositionZ);
    3434                        _writer.WriteSingle (_position.z);
     35                       
     36                        _writer.WriteEndObject ();
     37                }
     38
     39                private static readonly byte[] jsonKeyDays = JsonWriter.GetEncodedPropertyNameWithBeginObject ("days");
     40                private static readonly byte[] jsonKeyHours = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("hours");
     41                private static readonly byte[] jsonKeyMinutes = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("minutes");
     42
     43                public static void WriteGameTimeObject (ref JsonWriter _writer, int _days, int _hours, int _minutes) {
     44                        _writer.WriteRaw (jsonKeyDays);
     45                        _writer.WriteInt32 (_days);
     46                       
     47                        _writer.WriteRaw (jsonKeyHours);
     48                        _writer.WriteInt32 (_hours);
     49                       
     50                        _writer.WriteRaw (jsonKeyMinutes);
     51                        _writer.WriteInt32 (_minutes);
    3552                       
    3653                        _writer.WriteEndObject ();
  • binary-improvements2/bin/Mods/TFP_WebServer/ModInfo.xml

    r435 r436  
    55        <Description value="Integrated Webserver for the Web Dashboard and server APIs" />
    66        <Author value="The Fun Pimps LLC" />
    7         <Version value="21.0.289.0" />
     7        <Version value="21.0.289.1" />
    88        <Website value="" />
    99</xml>
Note: See TracChangeset for help on using the changeset viewer.