testing work
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-08-19 19:38:20 -04:00
parent 0d80214dc8
commit 5ed2263fc5
7 changed files with 43 additions and 40 deletions

View File

@ -1,7 +1,6 @@
{ {
"entities" : [], "entities" : [],
"scriptPaths" : [], "scriptPaths" : [],
"initScriptPath" : "/Scenes/testscene1/scene.ts",
"realmDescriptor" : { "realmDescriptor" : {
"type" : "gridded", "type" : "gridded",
"griddedRealmSize" : 2 "griddedRealmSize" : 2

View File

@ -1,16 +0,0 @@
import { Scene } from "/Scripts/types/scene";
/**
* The main scene interface
*/
const TestScene1: Scene = {
persistentValues: {},
hooks: [],
signalHookMap: {},
sceneHooks: []
}
/**
* The scene to export
*/
export default TestScene1

View File

@ -213,13 +213,23 @@ public class ClientLoading {
EntityUtils.getScale(Globals.playerCursor).set(30f); EntityUtils.getScale(Globals.playerCursor).set(30f);
} }
static final int MAX_DRAW_CELL_WAIT = 1000;
static void initDrawCellManager(){ static void initDrawCellManager(){
int iterations = 0;
while(Globals.clientWorldData == null || Globals.initialAssetLoadingThread.isLoading()){ while(Globals.clientWorldData == null || Globals.initialAssetLoadingThread.isLoading()){
try { try {
TimeUnit.MILLISECONDS.sleep(10); TimeUnit.MILLISECONDS.sleep(10);
iterations++;
} catch (InterruptedException ex) { } catch (InterruptedException ex) {
LoggerInterface.loggerEngine.ERROR(ex); LoggerInterface.loggerEngine.ERROR(ex);
} }
if(iterations > MAX_DRAW_CELL_WAIT){
String message = "Draw cell took too long to init!\n" +
Globals.clientWorldData + "\n" +
Globals.initialAssetLoadingThread.isLoading();
throw new IllegalStateException(message);
}
} }
//initialize draw cell manager //initialize draw cell manager
Globals.drawCellManager = new DrawCellManager(Globals.clientTerrainManager, 0, 0, 0); Globals.drawCellManager = new DrawCellManager(Globals.clientTerrainManager, 0, 0, 0);

View File

@ -115,7 +115,7 @@ public class MessageProtocol {
public void handleSyncMessages(){ public void handleSyncMessages(){
Globals.profiler.beginAggregateCpuSample("MessageProtocol(client).handleSyncMessages"); Globals.profiler.beginAggregateCpuSample("MessageProtocol(client).handleSyncMessages");
this.synchronousMessageLock.acquireUninterruptibly(); this.synchronousMessageLock.acquireUninterruptibly();
LoggerInterface.loggerNetworking.DEBUG_LOOP("HANDLE SYNC MESSAGE [Sync queue size: " + this.synchronousMessageQueue.size() + "]"); LoggerInterface.loggerNetworking.DEBUG_LOOP("[SERVER] HANDLE SYNC MESSAGE [Sync queue size: " + this.synchronousMessageQueue.size() + "]");
for(NetworkMessage message : synchronousMessageQueue){ for(NetworkMessage message : synchronousMessageQueue){
switch(message.getType()){ switch(message.getType()){
case AUTH_MESSAGE: case AUTH_MESSAGE:

View File

@ -402,7 +402,7 @@ public class ServerConnectionHandler implements Runnable {
*/ */
private void disconnect(){ private void disconnect(){
//close socket //close socket
if(socket.isConnected()){ if(socket != null && socket.isConnected()){
try { try {
socket.close(); socket.close();
} catch (IOException e) { } catch (IOException e) {

View File

@ -25,17 +25,17 @@ public class ServerEquipStateTests extends EntityTestTemplate {
public void spawningWithEquippedItem(){ public void spawningWithEquippedItem(){
TestEngineUtils.simulateFrames(1); TestEngineUtils.simulateFrames(1);
//spawn entities //spawn entities
// CreatureTemplate creatureTemplate = CreatureTemplate.createDefault("human"); CreatureTemplate creatureTemplate = CreatureTemplate.createDefault("human");
// Entity creature = CreatureUtils.serverSpawnBasicCreature(Globals.realmManager.first(), new Vector3d(0,0,0), "human", creatureTemplate); Entity creature = CreatureUtils.serverSpawnBasicCreature(Globals.realmManager.first(), new Vector3d(0,0,0), "human", creatureTemplate);
// Entity katana = ItemUtils.serverSpawnBasicItem(Globals.realmManager.first(), new Vector3d(0,0,0), "katana2H"); Entity katana = ItemUtils.serverSpawnBasicItem(Globals.realmManager.first(), new Vector3d(0,0,0), "katana2H");
//equip //equip
// Entity inInventoryItem = InventoryUtils.serverAttemptStoreItem(creature, katana); Entity inInventoryItem = InventoryUtils.serverAttemptStoreItem(creature, katana);
// ServerEquipState serverEquipState = ServerEquipState.getServerEquipState(creature); ServerEquipState serverEquipState = ServerEquipState.getServerEquipState(creature);
// serverEquipState.commandAttemptEquip(inInventoryItem, serverEquipState.getEquipPoint("handsCombined")); serverEquipState.commandAttemptEquip(inInventoryItem, serverEquipState.getEquipPoint("handsCombined"));
// //verify was equipped //verify was equipped
// assertNotNull(serverEquipState.getEquippedItemAtPoint("handsCombined")); assertNotNull(serverEquipState.getEquippedItemAtPoint("handsCombined"));
} }
} }

View File

@ -1,9 +1,14 @@
package testutils; package testutils;
import java.util.concurrent.TimeUnit;
import electrosphere.engine.Globals;
import electrosphere.engine.loadingthreads.LoadingThread; import electrosphere.engine.loadingthreads.LoadingThread;
import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType; import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType;
import electrosphere.entity.scene.SceneFile; import electrosphere.logger.LoggerInterface;
import electrosphere.menu.mainmenu.MenuGeneratorsLevelEditor.LevelDescription; import electrosphere.logger.Logger.LogLevel;
import electrosphere.menu.WindowStrings;
import electrosphere.renderer.ui.elements.Window;
public class EngineInit { public class EngineInit {
@ -12,21 +17,26 @@ public class EngineInit {
*/ */
public static void setupConnectedTestScene(){ public static void setupConnectedTestScene(){
// LoadingThread loadingThread = null;
//create the scene
LevelDescription inFlightLevel = new LevelDescription();
SceneFile sceneFile = SceneFile.createSceneFile();
inFlightLevel.setSceneFile(sceneFile);
inFlightLevel.setName("testscene1");
sceneFile.setCreateSaveInstance(false);
sceneFile.getRealmDescriptor().setGriddedRealmSize(1);
LoadingThread loadingThread = new LoadingThread(LoadingThreadType.LEVEL_EDITOR, inFlightLevel);
loadingThread.run();
// //
//load the scene //load the scene
loadingThread = new LoadingThread(LoadingThreadType.LEVEL,"testscene1"); loadingThread = new LoadingThread(LoadingThreadType.LEVEL,"testscene1");
loadingThread.run(); loadingThread.start();
LoggerInterface.loggerNetworking.setLevel(LogLevel.LOOP_DEBUG);
//
//wait for client to be fully init'd
while(((Window)Globals.elementManager.getWindow(WindowStrings.WINDOW_LOADING)).getVisible() || Globals.playerEntity == null){
TestEngineUtils.simulateFrames(1);
try {
TimeUnit.MILLISECONDS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
} }
} }