Server Sync

Player move on sync
This commit is contained in:
AliIbnAbiTalib
2023-02-20 21:51:15 +01:00
parent 12c8843fed
commit 311f141feb
14 changed files with 66 additions and 25 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
Generated
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
+29 -3
View File
@@ -2,10 +2,16 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="e1ac5a43-1258-486e-9afa-562e60808847" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/FlufflParty/.idea/.idea.FlufflParty/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FlufflParty/Assets/Scripts/Client.cs" beforeDir="false" afterPath="$PROJECT_DIR$/FlufflParty/Assets/Scripts/Client.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FlufflParty/Packages/manifest.json" beforeDir="false" afterPath="$PROJECT_DIR$/FlufflParty/Packages/manifest.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FlufflParty/Assets/Scripts/ItemShop.cs" beforeDir="false" afterPath="$PROJECT_DIR$/FlufflParty/Assets/Scripts/ItemShop.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs" beforeDir="false" afterPath="$PROJECT_DIR$/FlufflParty/Assets/Scripts/Players/NoPlayablePlayer.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs" beforeDir="false" afterPath="$PROJECT_DIR$/FlufflParty/Assets/Scripts/Players/PlayablePlayer.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FlufflParty/Assets/Scripts/Players/Player.cs" beforeDir="false" afterPath="$PROJECT_DIR$/FlufflParty/Assets/Scripts/Players/Player.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FlufflParty/Packages/packages-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/FlufflParty/Packages/packages-lock.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/FlufflParty/ProjectSettings/ProjectVersion.txt" beforeDir="false" afterPath="$PROJECT_DIR$/FlufflParty/ProjectSettings/ProjectVersion.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Server/src/Room.java" beforeDir="false" afterPath="$PROJECT_DIR$/Server/src/Room.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -28,9 +34,28 @@
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"WebServerToolWindowFactoryState": "false",
"last_opened_file_path": "C:/flufflparty"
"last_opened_file_path": "C:/flufflparty/Server",
"project.structure.last.edited": "Project",
"project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.0",
"settings.editor.selected.configurable": "preferences.lookFeel"
}
}]]></component>
<component name="RunManager">
<configuration default="true" type="JetRunConfigurationType">
<module name="flufflparty" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType">
<module name="flufflparty" />
<option name="filePath" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
@@ -40,6 +65,7 @@
<option name="presentableId" value="Default" />
<updated>1676488026665</updated>
<workItem from="1676488028412" duration="3783000" />
<workItem from="1676925887035" duration="132000" />
</task>
<servers />
</component>
+9 -1
View File
@@ -1,7 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="f0abe486-ee58-49bd-ad63-04a8b3fc78ec" name="Changes" comment="" />
<list default="true" id="f0abe486-ee58-49bd-ad63-04a8b3fc78ec" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.FlufflParty/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.FlufflParty/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Client.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Client.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/ItemShop.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/ItemShop.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Players/NoPlayablePlayer.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Players/NoPlayablePlayer.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Players/PlayablePlayer.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Players/PlayablePlayer.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Players/Player.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Players/Player.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Packages/packages-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/Packages/packages-lock.json" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+1 -1
View File
@@ -130,7 +130,7 @@ public class Client : MonoBehaviour
((NoPlayablePlayer)players[job.data[1]]).CoinFieldAction(job.data[2]);
break;
case 7:
((NoPlayablePlayer)players[job.data[1]]).EventStopFinished();
(players[job.data[1]]).EventStopFinished();
break;
case 126:
stream.Write(new byte[]{126, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 10);
+9 -6
View File
@@ -4,15 +4,18 @@ using UnityEngine;
public class ItemShop : MonoBehaviour
{
// Start is called before the first frame update
void Start()
[SerializeField] private GameObject Layout2;
[SerializeField] private GameObject LayoutItemShop;
[SerializeField] private Client client;
public void buttonMoveOn()
{
Layout2.SetActive(false);
client.EventStopFinished();
}
// Update is called once per frame
void Update()
public void buttonEnter()
{
Layout2.SetActive(false);
LayoutItemShop.SetActive(true);
}
}
@@ -152,9 +152,4 @@ public class NoPlayablePlayer : Player
}
}
public void EventStopFinished()
{
eventstop = false;
}
}
@@ -37,12 +37,13 @@ public class PlayablePlayer : Player
private void Update()
{
if (Input.GetMouseButtonDown(0))
/*
if (Input.GetMouseButtonDown(0))
{
eventstop = false;
client.EventStopFinished();
}
*/
if (activated && !name.Equals(""))
{
//Generiere Würfelzahl von 1-6 wenn gerade gewürfelt werden darf
@@ -70,4 +70,9 @@ public abstract class Player : MonoBehaviour
eventstop = true;
Layout2.SetActive(true);
}
public void EventStopFinished()
{
eventstop = false;
}
}
+3 -3
View File
@@ -47,8 +47,8 @@
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.ide.visualstudio": "2.0.16",
"com.unity.ide.rider": "3.0.16",
"com.unity.ide.visualstudio": "2.0.17",
"com.unity.ide.rider": "3.0.18",
"com.unity.ide.vscode": "1.2.5",
"com.unity.editorcoroutines": "1.0.0",
"com.unity.performance.profile-analyzer": "1.1.1",
@@ -112,7 +112,7 @@
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.6.0",
"version": "1.7.0",
"depth": 1,
"source": "registry",
"dependencies": {
Binary file not shown.
Binary file not shown.
Binary file not shown.
-3
View File
@@ -171,10 +171,7 @@ public class Room
case 7:
for (int i = 0; i < players.length; i++)
{
if (i != player)
{
players[i].output.write(new byte[]{7, (byte)player, 0, 0, 0, 0, 0, 0, 0, 0});
}
}
break;
case 126: