public static SettingsResponse FromBytes(byte[] bytes)
 {
     VRage.ByteStream stream = new VRage.ByteStream(bytes, bytes.Length);
     SettingsResponse response = new SettingsResponse();
     response.LoadFromByteStream(stream);
     response.Settings = new Settings(stream);
     return response;
 }
Esempio n. 2
0
        public static SettingsResponse FromBytes(byte[] bytes)
        {
            VRage.ByteStream stream   = new VRage.ByteStream(bytes, bytes.Length);
            SettingsResponse response = new SettingsResponse();

            response.LoadFromByteStream(stream);
            response.Settings = new Settings(stream);
            return(response);
        }
        private void ReceiveChangeSettingRequest(byte[] body, ulong senderId)
        {
            Log.Trace("Receiving Change Settings Request", "ReceiveConcealRequest");

            ChangeSettingRequest request = ChangeSettingRequest.FromBytes(body);

            Settings.Instance.ChangeSetting(request.Index, request.Value);

            /*
             * We actually resend settings, incase player is relying on them for data
            ChangeSettingResponse response = new ChangeSettingResponse() {
                Success = true
            };
            */

            SettingsResponse response = new SettingsResponse() {
                Settings = Settings.Instance
            };

            response.SendToPlayer(senderId);
        }
        private void ReceiveSettingsRequest(byte[] body, ulong senderId)
        {
            Log.Trace("Receiving Settings Request", "ReceiveConcealRequest");

            SettingsRequest request = SettingsRequest.FromBytes(body);

            SettingsResponse response = new SettingsResponse() {
                Settings = Settings.Instance
            };

            response.SendToPlayer(senderId);
        }