Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment3 #7

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
e585d44
socket conn
jaytjeboy Mar 9, 2022
b357ce9
netty
jaytjeboy Mar 9, 2022
475b13c
gamestate change
jaytjeboy Mar 9, 2022
3748553
exit and welcome
jaytjeboy Mar 9, 2022
90705e2
state checl
jaytjeboy Mar 9, 2022
48571d6
Changed the check command
Mar 10, 2022
93bc6e2
Added exit function.
Mar 10, 2022
ec65a6d
Added jar file
Mar 11, 2022
ba17cd7
Added jar file
Mar 11, 2022
a2615ed
Gamesequence addition
jaytjeboy Mar 11, 2022
4db6ab0
Jar file update
Mar 11, 2022
314c5e2
Jar file update
Mar 11, 2022
832668b
Doc uploaded
Mar 11, 2022
ff1f197
Doc uploaded
Mar 11, 2022
d3c338f
gui
ZefanM Mar 16, 2022
2e24cb2
server
jaytjeboy Mar 16, 2022
09e1ffb
Generic type
jaytjeboy Mar 16, 2022
b16da6f
username fetch
jaytjeboy Mar 17, 2022
5505896
POST handler + gitignore
jaytjeboy Mar 18, 2022
c79d48a
gradle runs
Mar 18, 2022
6b30119
gui
ZefanM Mar 20, 2022
ecfa88c
merge
ZefanM Mar 20, 2022
519d901
reassigned gitignore
jaytjeboy Mar 22, 2022
5e1ac50
used gitignore
jaytjeboy Mar 22, 2022
cdde0f6
delete of main and commandhandler
jaytjeboy Mar 22, 2022
ce3b9ab
merge with backend
jaytjeboy Mar 22, 2022
99fbbd9
Get password from server
jaytjeboy Mar 22, 2022
6b345e3
Server logic
jaytjeboy Mar 22, 2022
9304211
MasterController pushed
Mar 23, 2022
4468018
Changed the screenswitch between after login
Mar 23, 2022
4de4bcb
functionally working
Mar 23, 2022
0920fd3
changed the paths, images and styling now functional again
Mar 23, 2022
b9c3283
Added POST invite and GET users + some constants
jaytjeboy Mar 24, 2022
8d59b99
Merge pull request #3 from JazzleyLouisville/feature/user-actions-and…
Jaystah Mar 25, 2022
5b22150
DevScreen implementation
Mar 25, 2022
f013b45
fixed some stuff
jaytjeboy Mar 25, 2022
5ce8b20
l
Mar 25, 2022
b467f7d
Merge pull request #5 from JazzleyLouisville/devscreen
Jaystah Mar 25, 2022
c54ff1c
Merge pull request #6 from JazzleyLouisville/feature/user-actions-and…
Jaystah Mar 25, 2022
1960bfd
working list for invite!
Mar 31, 2022
e76be6f
back buttons implemented
Mar 31, 2022
b368afc
Invite from list working, need to send it to the backend and have the
Mar 31, 2022
d824bf9
Label disappears after 1 second, small gui update
Mar 31, 2022
8178081
Back button for dev screen
Apr 1, 2022
141485c
dev game add
jaytjeboy Apr 3, 2022
d91ed26
onInvite
jaytjeboy Apr 3, 2022
9f34df7
delete player
jaytjeboy Apr 3, 2022
03d106f
alert on invite implemented
Apr 3, 2022
9f13089
invited users
jaytjeboy Apr 3, 2022
1e2c4da
added some functions to clean up the code
Apr 3, 2022
5e1f29c
Users
jaytjeboy Apr 3, 2022
6c63ace
Displayed games in a listview in the game sequence tab
Apr 4, 2022
97d7bf7
waitingroom invite working?
Apr 4, 2022
0db1423
screenchange test
Apr 4, 2022
6554a34
clr btn
Apr 4, 2022
60d2e45
delete selected
jaytjeboy Apr 4, 2022
6cd2727
delete selected
jaytjeboy Apr 4, 2022
a345ff6
assignment 3 pdf
jaytjeboy Apr 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
gamestate change
jaytjeboy committed Mar 9, 2022
commit 475b13c010ce04e641e187165b917cd945e08d82
Binary file modified .gradle/6.8.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/6.8.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/6.8.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/6.8.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/6.8.1/javaCompile/classAnalysis.bin
Binary file not shown.
Binary file modified .gradle/6.8.1/javaCompile/javaCompile.lock
Binary file not shown.
Binary file modified .gradle/6.8.1/javaCompile/taskHistory.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/checksums/checksums.lock
Binary file not shown.
Binary file modified .gradle/checksums/md5-checksums.bin
Binary file not shown.
Binary file modified .gradle/checksums/sha1-checksums.bin
Binary file not shown.
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -13,4 +13,8 @@ repositories {

dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.13.1'
// https://mvnrepository.com/artifact/io.netty/netty-all
implementation group: 'io.netty', name: 'netty-all', version: '4.1.71.Final'
// https://mvnrepository.com/artifact/io.socket/socket.io-client
implementation group: 'io.socket', name: 'socket.io-client', version: '2.0.1'
}
Binary file not shown.
Binary file added build/classes/java/main/softwaredesign/Main.class
Binary file not shown.
4 changes: 4 additions & 0 deletions build/tmp/compileJava/source-classes-mapping.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
softwaredesign/Main.java
softwaredesign.Main
softwaredesign/CommandHandler.java
softwaredesign.CommandHandler
Binary file removed lib/netty-all-4.1.42.Final.jar
Binary file not shown.
39 changes: 39 additions & 0 deletions src/main/java/softwaredesign/CommandHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package softwaredesign;

import java.util.HashMap;
import java.util.Map;

public class CommandHandler {
Map<String, String> games;

public CommandHandler() {
games = new HashMap<>();
}

protected void setGameState(String command) {
String[] commandSplitted = command.split(" ");
if (commandSplitted.length > 4) {
System.out.println("Invalid command");
return;
}
String gameName = commandSplitted[2];
String state = commandSplitted[3];
games.put(gameName, state);
System.out.println("Set the game " + gameName + " to " + state);
}

protected void getGameState(String command) {
String[] commandSplitted = command.split(" ");
if (commandSplitted.length > 3) {
System.out.println("Invalid command");
return;
}
String gameName = commandSplitted[2];
String state = games.get(gameName);
if (state == null) {
System.out.println("The game " + gameName + " does not exist!");
return;
}
System.out.println("The gamestate of " + gameName + " is " + state);
}
}
31 changes: 14 additions & 17 deletions src/main/java/softwaredesign/Main.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
package softwaredesign;

import java.io.*;
import java.util.Scanner;

import java.net.*;
import java.util.Arrays;
import io.netty.*
public class Main {
public static void main (String[] args) throws IOException {
Socket socket = new Socket();
InetAddress inetAddress=InetAddress.getByName("localhost");
System.out.println(inetAddress.toString());
//the port should be greater or equal to 0, else it will throw an error
int port=3333;
//calling the constructor of the SocketAddress class
SocketAddress socketAddress=new InetSocketAddress(inetAddress, port);
//binding the socket with the inetAddress and port number
//connect() method connects the specified socket to the server
socket.connect(socketAddress);
System.out.println("Inet address: "+socket.getInetAddress());
System.out.println("Port number: "+socket.getLocalPort());
public static void main (String[] args) {
CommandHandler commandHandler = new CommandHandler();
while (true) {
System.out.print("> ");
Scanner scanner = new Scanner(System.in);
String command = scanner.nextLine();
System.out.println(command);
if(command.contains("SET GAMESTATE")) {
commandHandler.setGameState(command);
} else if(command.contains("GET GAMESTATE")) {
commandHandler.getGameState(command);
}
}
}
}