This commit is contained in:
brausjonas
2023-04-10 15:38:01 +02:00
parent e60b637e20
commit 1435baa2e5
8 changed files with 6 additions and 2 deletions
@@ -94,15 +94,18 @@ public class StartHandler : MonoBehaviour
Stream stream = client.GetStream(); Stream stream = client.GetStream();
byte[] readMessage = new byte[10]; byte[] readMessage = new byte[10];
stream.Write(new byte[]{4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}); stream.Write(new byte[]{4, 0, 0, 0, 0, 0, 0, 0, 0, 0});
stream.Read(readMessage, 0, 10); stream.Read(readMessage, 0, 10);
string s = Encoding.ASCII.GetString(readMessage); string s = Encoding.ASCII.GetString(readMessage);
Debug.Log(s);
PlayerPrefs.SetString("roomcode", s); PlayerPrefs.SetString("roomcode", s);
PlayerPrefs.Save(); PlayerPrefs.Save();
SceneManager.LoadScene(1, LoadSceneMode.Single); SceneManager.LoadScene(1, LoadSceneMode.Single);
stream.Close();
} }
public void ButtonJoin() public void ButtonJoin()
+1 -1
View File
@@ -98,7 +98,7 @@
<workItem from="1680352829832" duration="680000" /> <workItem from="1680352829832" duration="680000" />
<workItem from="1680353695912" duration="624000" /> <workItem from="1680353695912" duration="624000" />
<workItem from="1680470998642" duration="1402000" /> <workItem from="1680470998642" duration="1402000" />
<workItem from="1681130452664" duration="2086000" /> <workItem from="1681130452664" duration="3287000" />
</task> </task>
<servers /> <servers />
</component> </component>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -179,6 +179,7 @@ public class Server
byte[] tempRoomCode = generateRoomCode(); byte[] tempRoomCode = generateRoomCode();
Room tempRoom = new Room(new String(tempRoomCode, StandardCharsets.US_ASCII), server); Room tempRoom = new Room(new String(tempRoomCode, StandardCharsets.US_ASCII), server);
publicRooms.add(tempRoom); publicRooms.add(tempRoom);
rooms.put(new String(tempRoomCode, StandardCharsets.US_ASCII), tempRoom);
output.write(tempRoomCode); output.write(tempRoomCode);
System.out.println("Room " + new String(tempRoomCode, StandardCharsets.US_ASCII) + " successfully created!"); System.out.println("Room " + new String(tempRoomCode, StandardCharsets.US_ASCII) + " successfully created!");