working on steam multiplayer

This commit is contained in:
2025-06-24 14:45:26 +02:00
parent 3f62560279
commit 40d07041fa
41 changed files with 13770 additions and 55 deletions

View File

@@ -8,6 +8,8 @@ using RebootKit.Engine.Services.Console;
using RebootKit.Engine.Services.Crosshair;
using RebootKit.Engine.Services.GameMode;
using RebootKit.Engine.Services.Simulation;
using UnityEngine;
using Logger = RebootKit.Engine.Foundation.Logger;
namespace RebootReality.jelycho.Main {
public static class JelychoConsoleCommands {
@@ -61,9 +63,33 @@ namespace RebootReality.jelycho.Main {
RR.Console.WriteToOutput($" {worldConfigAsset.Config.name}");
}
}
[RCCMD("connect", "Connects to a server with given Steam ID. Usage: connect <steam_id>")]
public static void ConnectToServer(string[] args) {
RR.Console.WriteToOutput("Connecting to server...");
if (args.Length != 1) {
RR.Console.WriteToOutput($"Usage: {args[0]} <steam_id>");
return;
}
RR.ConnectToLobby();
}
[RCCMD("disconnect", "Disconnects from the current server")]
public static void DisconnectFromServer(string[] args) {
if (args.Length != 1) {
RR.Console.WriteToOutput($"Usage: {args[0]}");
return;
}
RR.Disconnect();
}
}
public class JelychoGame : IGame {
static readonly Logger s_Logger = new Logger(nameof(JelychoGame));
[Serializable]
public class Config {
public string mainMenuWorld = "main_menu";
@@ -82,6 +108,8 @@ namespace RebootReality.jelycho.Main {
}
public async UniTask InitAsync(CancellationToken cancellationToken) {
Screen.SetResolution(1600, 900, FullScreenMode.Windowed);
RR.CreateService<CrosshairService>();
await UniTask.Yield();
}
@@ -103,9 +131,19 @@ namespace RebootReality.jelycho.Main {
}
public void NewGame() {
NewGameAsync().Forget();
}
async UniTask NewGameAsync() {
RR.HostServer();
await UniTask.WaitForSeconds(0.5f);
s_Logger.Info("Starting new game");
s_Logger.Info($"Is connected: {RR.IsClient()}");
s_Logger.Info($"Is host: {RR.IsHost()}");
GameModeAsset gameModeAsset = RR.GetGameMode(m_Config.standardGameMode);
WorldConfigAsset worldConfigAsset = RR.GetWorldConfigAsset(m_Config.mainGameplayWorld);
RR.StartGameMode(gameModeAsset, worldConfigAsset.Config);
}
}

View File

@@ -1,10 +1,11 @@
using RebootKit.Engine.Main;
using TriInspector;
using UnityEngine;
namespace RebootReality.jelycho.Main {
[CreateAssetMenu(menuName = GameConsts.k_AddComponentMenu + "Jelycho Game")]
public class JelychoGameAsset : GameAsset {
[SerializeField] JelychoGame.Config m_Config;
[SerializeField, InlineProperty, HideLabel] JelychoGame.Config m_Config;
public override IGame CreateGame() {
return new JelychoGame(m_Config);

View File

@@ -169,7 +169,7 @@ MonoBehaviour:
m_WorldUpAxis: 2
m_MaintainOffset: 0
m_ConstrainedAxes:
x: 1
x: 0
y: 1
z: 0
--- !u!1 &1983664058802278619
@@ -545,8 +545,8 @@ MonoBehaviour:
transform: {fileID: 0}
weight: 0
m_Offset: {x: 0, y: 0, z: 0}
m_MinLimit: -45
m_MaxLimit: 45
m_MinLimit: -20
m_MaxLimit: 20
m_AimAxis: 4
m_UpAxis: 2
m_WorldUpType: 0
@@ -555,7 +555,7 @@ MonoBehaviour:
m_MaintainOffset: 0
m_ConstrainedAxes:
x: 1
y: 1
y: 0
z: 0
--- !u!1 &5676754449618046431
GameObject:
@@ -566,9 +566,9 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 8014384043901115190}
- component: {fileID: 8715525475363827866}
- component: {fileID: 8531226034841258401}
m_Layer: 0
m_Name: Foot Left IK
m_Name: Left Arm Rest
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -586,10 +586,11 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Children:
- {fileID: 3084798835676300500}
m_Father: {fileID: 5180453452427343145}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8715525475363827866
--- !u!114 &8531226034841258401
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@@ -598,21 +599,51 @@ MonoBehaviour:
m_GameObject: {fileID: 5676754449618046431}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aeda7bfbf984f2a4da5ab4b8967b115d, type: 3}
m_Script: {fileID: 11500000, guid: e3c430f382484144e925c097c2d33cfe, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Weight: 1
m_Data:
m_Root: {fileID: 0}
m_Mid: {fileID: 0}
m_Tip: {fileID: 0}
m_Target: {fileID: 0}
m_Hint: {fileID: 0}
m_TargetPositionWeight: 1
m_TargetRotationWeight: 1
m_HintWeight: 1
m_MaintainTargetPositionOffset: 0
m_MaintainTargetRotationOffset: 0
m_ConstrainedObject: {fileID: 66317331002764483}
m_SourceObjects:
m_Length: 1
m_Item0:
transform: {fileID: 3084798835676300500}
weight: 1
m_Item1:
transform: {fileID: 0}
weight: 0
m_Item2:
transform: {fileID: 0}
weight: 0
m_Item3:
transform: {fileID: 0}
weight: 0
m_Item4:
transform: {fileID: 0}
weight: 0
m_Item5:
transform: {fileID: 0}
weight: 0
m_Item6:
transform: {fileID: 0}
weight: 0
m_Item7:
transform: {fileID: 0}
weight: 0
m_Offset: {x: 0, y: 0, z: 0}
m_MinLimit: -180
m_MaxLimit: 180
m_AimAxis: 2
m_UpAxis: 4
m_WorldUpType: 0
m_WorldUpObject: {fileID: 0}
m_WorldUpAxis: 2
m_MaintainOffset: 0
m_ConstrainedAxes:
x: 1
y: 1
z: 1
--- !u!1 &6086846679135428685
GameObject:
m_ObjectHideFlags: 0
@@ -870,7 +901,7 @@ Transform:
m_GameObject: {fileID: 6133802031166091545}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -1.425, y: 0.904, z: 0.85}
m_LocalPosition: {x: 0, y: 0.209, z: 0.85}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -900,13 +931,13 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6960540633905036714}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0.34663126, z: -0, w: 0.9380015}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7761779135599839476}
m_LocalEulerAnglesHint: {x: 0, y: -40.563, z: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7887986861182861129
GameObject:
m_ObjectHideFlags: 0
@@ -1087,6 +1118,37 @@ MonoBehaviour:
x: 1
y: 1
z: 1
--- !u!1 &8602796543922544418
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3084798835676300500}
m_Layer: 0
m_Name: Arm Target
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3084798835676300500
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8602796543922544418}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8014384043901115190}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &5815892847420407803
PrefabInstance:
m_ObjectHideFlags: 0
@@ -1249,7 +1311,12 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5866666021909216657, guid: e74130c49b009364f90d176af44766be, type: 3}
propertyPath: m_WarningMessage
value:
value: "\nBinding warning: Some generic clip(s) animate transforms that are
already bound by a Humanoid avatar. These transforms can only be changed
by Humanoid clips.\n\tTransform 'mixamorig:Spine1'\n\tTransform 'mixamorig:Head'\n\tTransform
'mixamorig:Hips'\n\tTransform 'mixamorig:Spine2'\n\tTransform 'mixamorig:Neck'\n\tTransform
'mixamorig:Spine'\n\tTransform 'mixamorig:Spine1'\n\tTransform 'mixamorig:Head'\n\tTransform
'mixamorig:Hips'\n\tTransform 'mixamorig:Spine2'\n\tand more ..."
objectReference: {fileID: 0}
- target: {fileID: 5866666021909216657, guid: e74130c49b009364f90d176af44766be, type: 3}
propertyPath: m_ApplyRootMotion

View File

@@ -311,7 +311,7 @@ AnimatorStateMachine:
m_Position: {x: 340, y: 130, z: 0}
- serializedVersion: 1
m_State: {fileID: -8396421346802500550}
m_Position: {x: 356.19574, y: 383.26083, z: 0}
m_Position: {x: 360, y: 380, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions:
- {fileID: 1582007811057979629}
@@ -321,7 +321,7 @@ AnimatorStateMachine:
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 20, y: 380, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 650, y: 340, z: 0}
m_ExitPosition: {x: 640, y: 380, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 400375029870675044}
--- !u!1102 &-1370786679102677242