Beispiel #1
0
 public static void AttachAudioComponents(Contexts context, PlayerEntity playerEntity)
 {
     GameAudioMedia.Dispose();
     playerEntity.AddPlayerAudio();
     GameModuleManagement.ForceAllocate(playerEntity.entityKey.Value.EntityId,
                                        (PlayerAudioController audioController) => { audioController.Initialize(playerEntity); });
 }
Beispiel #2
0
        private static void AttachAudio(Contexts context, PlayerEntity playerEntity)
        {
            GameAudioMedia.Dispose();
            playerEntity.AddPlayerAudio();
            PlayerAudioControllerBase controller;

            if (SharedConfig.IsServer)
            {
                controller = new ServerPlayerAudioController();
            }
            else
            {
                controller = new ClientPlayerAudioController();
            }
            controller.Initialize(playerEntity, context.session.commonSession.RoomInfo.MapId);
            GameModuleManagement.ForceCache(playerEntity.entityKey.Value.EntityId, controller);
        }