Skip to content

Commit

Permalink
Merge branch 'develop' into ingame_metric
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielXia committed Jul 29, 2017
2 parents 430c4b5 + c251f81 commit 30772b1
Show file tree
Hide file tree
Showing 185 changed files with 5,031 additions and 2,246 deletions.
10 changes: 7 additions & 3 deletions docs/Credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ Contributors
[Rez 'zproc' N.](https://github.com/zproc),
[Christoph "Chrisk" Köbke](https://github.com/ChrisKoebke),
[Maternal](http://forum.terasology.org/members/maternal.810/),
[Trekmarvel](https://github.com/Trekmarvel)
* Design Team:
[Trekmarvel](https://github.com/Trekmarvel),
[quaternius](https://github.com/quaternius) ([Twitter](https://twitter.com/quaternius))
* Design Team:
[Rasmus 'Cervator' Praestholm](https://github.com/Cervator),
[Overdhose](https://github.com/Overdhose),
[Cynthia 'woodspeople' Kurtz](http://forum.terasology.org/members/woodspeople.34/),
Expand Down Expand Up @@ -199,7 +200,10 @@ Contributors
[Vizaxo](https://github.com/Vizaxo),
[theobisproject](https://github.com/theobisproject),
[omomthings](https://github.com/omomthings),
[njd5475](https://github.com/njd5475)
[njd5475](https://github.com/njd5475),
[Owl-A](https://github.com/Owl-A),
[niksoc](https://github.com/niksoc),
[TheFlash98](https://github.com/TheFlash98)
* GUI Team:
[Anton "small-jeeper" Kireev](https://github.com/small-jeeper),
[miniME89](https://github.com/miniME89),
Expand Down
11 changes: 10 additions & 1 deletion docs/Modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ Here's a list of modules bundled with the game by default (this line-up will cha
*Note about "Tutorial" modules:* These are more likely for some time to be for developers/modders to learn about different kinds of content and systems, not for players to actually learn stuff in-game. That's usually handled by actual content modules including their own in-game help system.

* [AdvancedBehaviors](https://github.com/Terasology/AdvancedBehaviors) - adds behavior trees and logic for NPCs!
* [AdventureAssets](https://github.com/Terasology/AdventureAssets) - a set of assets for adventure time!
* [Alchemy](https://github.com/Terasology/Alchemy) - create alchemical potions!
* [AlterationEffects](https://github.com/Terasology/AlterationEffects) - module for storing some buff/debuff type effects
* [Anatomy](https://github.com/Terasology/Anatomy) - an anatomical system meant to provide an alternative to typical HP only systems
* [AnotherWorld](https://github.com/Terasology/AnotherWorld) - world gen module, includes features like ore placement and caves, used by WoodAndStone's world
* [AnotherWorldPlants](https://github.com/Terasology/AnotherWorldPlants) - farming and tree growth for AnotherWorld
* [BlockDetector](https://github.com/Terasology/BlockDetector) - adds a simple little tool that can detect specific blocks (beeping in proximity)
Expand All @@ -34,7 +36,8 @@ Here's a list of modules bundled with the game by default (this line-up will cha
* [ChrisVolume1OST](https://github.com/Terasology/ChrisVolume1OST) - official game soundtrack by Chris Köbke - volume 1
* [ChrisVolume2OST](https://github.com/Terasology/ChrisVolume2OST) - official game soundtrack by Chris Köbke - volume 2
* [Cities](https://github.com/Terasology/Cities) - procedural city placer and plot organizer, also places roads to connect cities. Later split into Static and Dynamic variants
* [ClimateConditions](https://github.com/Terasology/ClimateConditions) - A library module for managing temperature, humidity, and other climate factors
* [ClimateConditions](https://github.com/Terasology/ClimateConditions) - A library module for managing temperature, humidity, and other climate factors
* [CombatSystem](https://github.com/Terasology/CombatSystem) - an advanced physics-based combat system
* [CommonWorld](https://github.com/Terasology/CommonWorld) - general world generation utility module
* [ComputerMonitors](https://github.com/Terasology/ComputerMonitors) - allows for the creation of functional multi-block monitors in-game - ModularComputers puts them to work!
* [Cooking](https://github.com/Terasology/Cooking) - cook stuff!
Expand All @@ -57,7 +60,9 @@ Here's a list of modules bundled with the game by default (this line-up will cha
* [GooeysQuests](https://github.com/Terasology/GooeysQuests) - spawn our mascot Gooey (console: `spawnPrefab gooey`) then `e` click to interact for commands and quests!
* [GrowingFlora](https://github.com/Terasology/GrowingFlora) - organically growing (step by step) trees and such
* [Hunger](https://github.com/Terasology/Hunger) - makes the player slowly gets hungry (needs actual GUI work and ways to then actually eat food though). Console `hungerCheck` for stats
* [Inferno](https://github.com/Terasology/Inferno) - live on in an underworld after death!
* [InGameHelp](https://github.com/Terasology/InGameHelp) - system for showing help in-game, default key `P`
* [InGameHelpAPI](https://github.com/Terasology/InGameHelpAPI) - separate API module for IGH to allow support but not forced activation for the help system
* [IRLCorp](https://github.com/Terasology/IRLCorp) - Industrialized Reduction of Labor Corporation - Helping workmen everywhere
* [ItemRendering](https://github.com/Terasology/ItemRendering) - a library for displaying "holographic" items in the world
* [JoshariasSurvival](https://github.com/Terasology/JoshariasSurvival) - formerly known as TerraTech - gameplay template for a machine-centric survival style
Expand All @@ -66,6 +71,7 @@ Here's a list of modules bundled with the game by default (this line-up will cha
* [LegacyMusic](https://github.com/Terasology/LegacyMusic) - older music pieces predating the official soundtrack
* [LightAndShadow](https://github.com/Terasology/LightAndShadow) - main module for the Light & Shadow gameplay
* [LightAndShadowResources](https://github.com/Terasology/LightAndShadowResources) - IMMA FIRIN’ MAH LASR!! Art assets for the Light & Shadow concept
* [Lost](https://github.com/Terasology/Lost) - gameplay template for a survival / exploration focused setting
* [Machines](https://github.com/Terasology/Machines) - machine infrastructure library module
* [Malicious](https://github.com/Terasology/Malicious) - a series of module security tests to check that modules cannot do naughty things when running
* [ManualLabor](https://github.com/Terasology/ManualLabor) - tools and logic for manual labor (digging, chopping, etc)
Expand Down Expand Up @@ -93,10 +99,12 @@ Here's a list of modules bundled with the game by default (this line-up will cha
* [Portals](https://github.com/Terasology/Portals) - allows placement of portal blocks that'll spawn Oreons `give portal`
* [PotentialEnergyDevices](https://github.com/Terasology/PotentialEnergyDevices) - A library for creating entities that build up potential energy
* [Potions](https://github.com/Terasology/Potions) - contains a set of assorted potions the player can consume to gain various effects
* [Projectile](https://github.com/Terasology/Projectile) - supported a variety of projectiles such as grenades and fireballs
* [QuestExamples](https://github.com/Terasology/QuestExamples) - samples for developers to help create quests
* [Rails](https://github.com/Terasology/Rails) - railroads and trains! Press `E` to start a caboose or enter a cart. Use the wrench to attach carts
* [Sample](https://github.com/Terasology/Sample) - miscellaneous example content showcasing module usage
* [Seasons](https://github.com/Terasology/Seasons) - adds seasons to the game
* [SegmentedPaths](https://github.com/Terasology/SegmentedPaths) - utility module for structured paths
* [ShatteredPlanes](https://github.com/Terasology/ShatteredPlanes) - a world generator focused on canyons, sky islands, and other somewhat radical terrain features
* [Signalling](https://github.com/Terasology/Signalling) - circuitry implementation based on BlockNetwork, similar to redstone
* [SimpleFarming](https://github.com/Terasology/SimpleFarming) - easy to understand growing of foods
Expand All @@ -119,6 +127,7 @@ Here's a list of modules bundled with the game by default (this line-up will cha
* [WeatherManager](https://github.com/Terasology/WeatherManager) - simple weather foundation, tracks whether, maintains a single cloud layer, and so on
* [WildAnimals](https://github.com/Terasology/WildAnimals) - a module containing animals, initially a deer you can spawn in-world via console with `spawnPrefab deer` then watch wander idly
* [WoodAndStone](https://github.com/Terasology/WoodAndStone) - big content module including "from scratch" crafting, starting with wood here
* [WoodAndStoneCraftingJournal](https://github.com/Terasology/WoodAndStoneCraftingJournal) - a Journal bridging module for WoodCrafting and StoneCrafting (no direct relation with the WoodAndStone module)
* [Workstation](https://github.com/Terasology/Workstation) - workstations offer a way to use blocks in-world for advanced purposes
* [WorkstationCrafting](https://github.com/Terasology/WorkstationCrafting) - an extension to Workstation focused on crafting more advanced recipe-based stuff
* [WorkstationInGameHelp](https://github.com/Terasology/WorkstationInGameHelp) - bridging module to bring in-game help to workstation screens
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2017 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.terasology.identity.storageServiceClient;

import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import org.junit.Test;

import java.math.BigInteger;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class BigIntegerBase64SerializerTest {

@Test
public void testSerializer() {
BigIntegerBase64Serializer serializer = new BigIntegerBase64Serializer();
BigInteger data = new BigInteger("123456789123456789123456789123456789");
JsonElement serialized = serializer.serialize(data, null, null);
assertTrue(serialized.isJsonPrimitive());
assertTrue(((JsonPrimitive) serialized).isString());
assertEquals(data, serializer.deserialize(serialized, null, null));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright 2017 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.terasology.identity.storageServiceClient;


import com.google.gson.Gson;
import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.HttpURLConnection;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class ServiceApiRequestTests {

static class DummySerializableObject {
private String fieldA;
private int fieldB;

private DummySerializableObject(String fieldA, int fieldB) {
this.fieldA = fieldA;
this.fieldB = fieldB;
}

@Override
public boolean equals(Object other) {
if (!(other instanceof DummySerializableObject)) {
return false;
}
DummySerializableObject o = (DummySerializableObject) other;
return fieldA.equals(o.fieldA) && fieldB == o.fieldB;
}
}

@Test
public void testRequest() throws IOException, StorageServiceException {
Gson gson = new Gson();
HttpURLConnection mockedConn = mock(HttpURLConnection.class);
ByteArrayOutputStream receivedRequest = new ByteArrayOutputStream();
ByteArrayInputStream response = new ByteArrayInputStream("{\"fieldA\":\"response\", \"fieldB\": 1}".getBytes());

when(mockedConn.getOutputStream()).thenReturn(receivedRequest);
when(mockedConn.getInputStream()).thenReturn(response);
when(mockedConn.getResponseCode()).thenReturn(200);

DummySerializableObject reqData = new DummySerializableObject("request", 0);
DummySerializableObject resData = ServiceApiRequest.request(mockedConn, HttpMethod.GET, null, reqData, DummySerializableObject.class);
assertEquals(gson.toJson(reqData), receivedRequest.toString());
assertEquals(new DummySerializableObject("response", 1), resData);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,64 @@ public void testUpdateMode() {
CharacterStateEvent state = new CharacterStateEvent();
state.setMode(MovementMode.WALKING);

KinematicCharacterMover.updateMode(state, false, true, true);
KinematicCharacterMover.updateMode(state, false, true, true, false);
Assert.assertSame(MovementMode.DIVING, state.getMode());

KinematicCharacterMover.updateMode(state, true, false, true);
KinematicCharacterMover.updateMode(state, true, false, true, false);
Assert.assertSame(MovementMode.SWIMMING, state.getMode());

state.setMode(MovementMode.FLYING);
KinematicCharacterMover.updateMode(state, false, true, true);
KinematicCharacterMover.updateMode(state, false, true, true, false);
Assert.assertSame(MovementMode.DIVING, state.getMode());

KinematicCharacterMover.updateMode(state, false, false, false);
KinematicCharacterMover.updateMode(state, false, false, false, false);
Assert.assertSame(MovementMode.WALKING, state.getMode());

KinematicCharacterMover.updateMode(state, false, false, true);
KinematicCharacterMover.updateMode(state, false, false, true, false);
Assert.assertSame(MovementMode.CLIMBING, state.getMode());

KinematicCharacterMover.updateMode(state, false, false, false);
KinematicCharacterMover.updateMode(state, false, false, false, false);
Assert.assertSame(MovementMode.WALKING, state.getMode());

state.setMode(MovementMode.GHOSTING);
KinematicCharacterMover.updateMode(state, false, true, false);
KinematicCharacterMover.updateMode(state, false, true, false, false);
Assert.assertSame(MovementMode.DIVING, state.getMode());

KinematicCharacterMover.updateMode(state, false, false, true);
KinematicCharacterMover.updateMode(state, false, false, true, false);
Assert.assertSame(MovementMode.CLIMBING, state.getMode());

state.setMode(MovementMode.WALKING);

KinematicCharacterMover.updateMode(state, false, true, true, true);
Assert.assertSame(MovementMode.DIVING, state.getMode());

KinematicCharacterMover.updateMode(state, true, false, true, true);
Assert.assertSame(MovementMode.SWIMMING, state.getMode());

state.setMode(MovementMode.FLYING);
KinematicCharacterMover.updateMode(state, false, true, true, true);
Assert.assertSame(MovementMode.DIVING, state.getMode());

KinematicCharacterMover.updateMode(state, false, false, false, true);
Assert.assertSame(MovementMode.CROUCHING, state.getMode());

KinematicCharacterMover.updateMode(state, false, false, true, true);
Assert.assertSame(MovementMode.CLIMBING, state.getMode());

KinematicCharacterMover.updateMode(state, false, false, false, true);
Assert.assertSame(MovementMode.CROUCHING, state.getMode());

state.setMode(MovementMode.GHOSTING);
KinematicCharacterMover.updateMode(state, false, true, false, true);
Assert.assertSame(MovementMode.DIVING, state.getMode());

KinematicCharacterMover.updateMode(state, false, false, true, true);
Assert.assertSame(MovementMode.CLIMBING, state.getMode());

KinematicCharacterMover.updateMode(state, false, false, false, false);
Assert.assertSame(MovementMode.WALKING, state.getMode());

KinematicCharacterMover.updateMode(state, false, false, false, true);
Assert.assertSame(MovementMode.CROUCHING, state.getMode());
}
}
4 changes: 2 additions & 2 deletions engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ dependencies {
compile group: 'org.terasology', name: 'gestalt-module', version: '5.1.2'
compile group: 'org.terasology', name: 'gestalt-asset-core', version: '5.1.2'
compile group: 'org.terasology', name: 'TeraMath', version: '1.4.0'
compile group: 'org.terasology.bullet', name: 'tera-bullet', version: '1.0.3'
compile group: 'org.terasology.bullet', name: 'tera-bullet', version: '1.3.1'
compile group: 'org.terasology', name: 'splash-screen', version: '1.0.2'

// Wildcard dependency to catch any libs provided with the project (remote repo preferred instead)
Expand Down Expand Up @@ -156,7 +156,7 @@ dependencies {
compile project(':libs:CrashReporter:cr-terasology')
} else {
println "*** Setting a CrashReporter binary dependency, not present as source"
compile group: 'org.terasology.crashreporter', name: 'cr-terasology', version: '4.0.1'
compile group: 'org.terasology.crashreporter', name: 'cr-terasology', version: '4.1.0'
}
}

Expand Down
4 changes: 4 additions & 0 deletions engine/src/main/java/org/terasology/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ public NUIEditorConfig getNuiEditor() {
return config.getNuiEditor();
}

public IdentityStorageServiceConfig getIdentityStorageService() {
return config.getIdentityStorageService();
}

public TelemetryConfig getTelemetryConfig() {
return config.getTelemetryConfig();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright 2017 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.terasology.config;

import java.net.URL;

/**
* Used to keep track of storage service URL and session token.
*/
public class IdentityStorageServiceConfig {

private URL serviceURL;
private String sessionToken;

public boolean isSet() {
return serviceURL != null && sessionToken != null;
}

public URL getServiceUrl() {
return serviceURL;
}

public String getSessionToken() {
return sessionToken;
}

public void setServiceURL(URL serviceURL) {
this.serviceURL = serviceURL;
}

public void setSessionToken(String sessionToken) {
this.sessionToken = sessionToken;
}

}
5 changes: 5 additions & 0 deletions engine/src/main/java/org/terasology/config/RootConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public final class RootConfig {
private NetworkConfig network = new NetworkConfig();
private SecurityConfig security = new SecurityConfig();
private NUIEditorConfig nuiEditor = new NUIEditorConfig();
private IdentityStorageServiceConfig identityStorageService = new IdentityStorageServiceConfig();
private TelemetryConfig telemetryConfig = new TelemetryConfig();

/**
Expand Down Expand Up @@ -94,6 +95,10 @@ public NUIEditorConfig getNuiEditor() {
return nuiEditor;
}

public IdentityStorageServiceConfig getIdentityStorageService() {
return identityStorageService;
}

public TelemetryConfig getTelemetryConfig() {
return telemetryConfig;
}
Expand Down

0 comments on commit 30772b1

Please sign in to comment.