Skip to content

Commit

Permalink
After contact dispatch refactoring, just keeping gameserver up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
assofohdz committed Jan 15, 2023
1 parent a7eeb4f commit 0a2749c
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions infinity/src/main/java/infinity/server/GameServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@

import java.io.*;

import com.jme3.scene.shape.Sphere;
import com.simsilica.bpos.mphys.BodyPositionPublisher;
import com.simsilica.bpos.mphys.LargeGridIndexSystem;
import infinity.sim.CorePhysicsConstants;
import infinity.sim.InfinityContactDispatcher;
import infinity.sim.ai.MobSystem;
import infinity.systems.*;
import org.slf4j.Logger;
Expand Down Expand Up @@ -263,11 +261,6 @@ public long getTime() {

MPhysSystem<MBlockShape> mphys = new MPhysSystem<>(InfinityConstants.PHYSICS_GRID, bodyFactory);

InfinityContactDispatcher dispatcher = new InfinityContactDispatcher();
systems.register(InfinityContactDispatcher.class, dispatcher);
mphys.getPhysicsSpace().setContactDispatcher(dispatcher);


Collider[] colliders = new ColliderFactories(true).createColliders(BlockTypeIndex.getTypes());
mphys.setCollisionSystem(new MBlockCollisionSystem<EntityId>(world, colliders));
// mphys.addPhysicsListener(new PositionUpdater(ed));
Expand All @@ -278,7 +271,11 @@ public long getTime() {
systems.register(EntityBodyFactory.class, bodyFactory);

// Subspace Infinity Specific Systems:-->
// systems.register(WeaponSystem.class, new WeaponSystem());
// Set up contacts to be filtered first:
ContactSystem contactSystem = new ContactSystem();
systems.register(ContactSystem.class, contactSystem);
mphys.getPhysicsSpace().setContactDispatcher(contactSystem);
//Then add gamesystems:
systems.register(EnergySystem.class, new EnergySystem());
systems.register(AvatarSystem.class, new AvatarSystem(chp));
systems.register(MovementSystem.class, new MovementSystem());
Expand All @@ -289,18 +286,12 @@ public long getTime() {
systems.register(ArenaSystem.class, new ArenaSystem());
systems.register(PrizeSystem.class, new PrizeSystem(mphys.getPhysicsSpace()));

// Set up contacts to be filtered
//final ContactSystem contactSystem = new ContactSystem();
//systems.register(ContactSystem.class, contactSystem);

//mphys.getPhysicsSpace().setContactDispatcher(contactSystem);
systems.register(InfinityTimeSystem.class, new InfinityTimeSystem());

final AssetLoaderService assetLoader = new AssetLoaderService();
server.getServices().addService(assetLoader);



final AdaptiveLoadingService adaptiveLoader = new AdaptiveLoadingService(systems);
server.getServices().addService(adaptiveLoader);

Expand Down

0 comments on commit 0a2749c

Please sign in to comment.