forked from IF-LK-2020/wordle
Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>UMLClass</id>
|
<id>UMLClass</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>192</x>
|
<x>114</x>
|
||||||
<y>438</y>
|
<y>438</y>
|
||||||
<w>270</w>
|
<w>270</w>
|
||||||
<h>96</h>
|
<h>96</h>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>UMLClass</id>
|
<id>UMLClass</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>258</x>
|
<x>180</x>
|
||||||
<y>348</y>
|
<y>348</y>
|
||||||
<w>126</w>
|
<w>126</w>
|
||||||
<h>42</h>
|
<h>42</h>
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>UMLClass</id>
|
<id>UMLClass</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>78</x>
|
<x>0</x>
|
||||||
<y>642</y>
|
<y>642</y>
|
||||||
<w>126</w>
|
<w>126</w>
|
||||||
<h>42</h>
|
<h>42</h>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>UMLClass</id>
|
<id>UMLClass</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>264</x>
|
<x>186</x>
|
||||||
<y>642</y>
|
<y>642</y>
|
||||||
<w>126</w>
|
<w>126</w>
|
||||||
<h>42</h>
|
<h>42</h>
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>UMLClass</id>
|
<id>UMLClass</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>258</x>
|
<x>180</x>
|
||||||
<y>246</y>
|
<y>246</y>
|
||||||
<w>126</w>
|
<w>126</w>
|
||||||
<h>42</h>
|
<h>42</h>
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>UMLClass</id>
|
<id>UMLClass</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>438</x>
|
<x>360</x>
|
||||||
<y>642</y>
|
<y>642</y>
|
||||||
<w>126</w>
|
<w>126</w>
|
||||||
<h>42</h>
|
<h>42</h>
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>Relation</id>
|
<id>Relation</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>318</x>
|
<x>240</x>
|
||||||
<y>384</y>
|
<y>384</y>
|
||||||
<w>18</w>
|
<w>18</w>
|
||||||
<h>66</h>
|
<h>66</h>
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>Relation</id>
|
<id>Relation</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>318</x>
|
<x>240</x>
|
||||||
<y>282</y>
|
<y>282</y>
|
||||||
<w>18</w>
|
<w>18</w>
|
||||||
<h>78</h>
|
<h>78</h>
|
||||||
@@ -115,18 +115,18 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>Relation</id>
|
<id>Relation</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>318</x>
|
<x>240</x>
|
||||||
<y>606</y>
|
<y>612</y>
|
||||||
<w>18</w>
|
<w>18</w>
|
||||||
<h>48</h>
|
<h>42</h>
|
||||||
</coordinates>
|
</coordinates>
|
||||||
<panel_attributes>lt=<..</panel_attributes>
|
<panel_attributes>lt=<..</panel_attributes>
|
||||||
<additional_attributes>10.0;60.0;10.0;10.0</additional_attributes>
|
<additional_attributes>10.0;50.0;10.0;10.0</additional_attributes>
|
||||||
</element>
|
</element>
|
||||||
<element>
|
<element>
|
||||||
<id>Relation</id>
|
<id>Relation</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>198</x>
|
<x>120</x>
|
||||||
<y>654</y>
|
<y>654</y>
|
||||||
<w>78</w>
|
<w>78</w>
|
||||||
<h>18</h>
|
<h>18</h>
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>Relation</id>
|
<id>Relation</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>384</x>
|
<x>306</x>
|
||||||
<y>654</y>
|
<y>654</y>
|
||||||
<w>66</w>
|
<w>66</w>
|
||||||
<h>18</h>
|
<h>18</h>
|
||||||
@@ -148,8 +148,8 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>UMLClass</id>
|
<id>UMLClass</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>264</x>
|
<x>186</x>
|
||||||
<y>552</y>
|
<y>558</y>
|
||||||
<w>126</w>
|
<w>126</w>
|
||||||
<h>60</h>
|
<h>60</h>
|
||||||
</coordinates>
|
</coordinates>
|
||||||
@@ -157,6 +157,7 @@
|
|||||||
--
|
--
|
||||||
- pullStats(user)
|
- pullStats(user)
|
||||||
+ pushStats(user)
|
+ pushStats(user)
|
||||||
|
+ createNewUser(user)
|
||||||
+ checkForLogin(String username, String passwort):boolean
|
+ checkForLogin(String username, String passwort):boolean
|
||||||
+ getWord(int)</panel_attributes>
|
+ getWord(int)</panel_attributes>
|
||||||
<additional_attributes/>
|
<additional_attributes/>
|
||||||
@@ -164,7 +165,7 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>UMLClass</id>
|
<id>UMLClass</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>540</x>
|
<x>462</x>
|
||||||
<y>426</y>
|
<y>426</y>
|
||||||
<w>126</w>
|
<w>126</w>
|
||||||
<h>156</h>
|
<h>156</h>
|
||||||
@@ -191,7 +192,7 @@
|
|||||||
<element>
|
<element>
|
||||||
<id>Relation</id>
|
<id>Relation</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>456</x>
|
<x>378</x>
|
||||||
<y>480</y>
|
<y>480</y>
|
||||||
<w>96</w>
|
<w>96</w>
|
||||||
<h>24</h>
|
<h>24</h>
|
||||||
@@ -203,21 +204,21 @@ m1=n</panel_attributes>
|
|||||||
<element>
|
<element>
|
||||||
<id>Relation</id>
|
<id>Relation</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>318</x>
|
<x>240</x>
|
||||||
<y>528</y>
|
<y>528</y>
|
||||||
<w>24</w>
|
<w>24</w>
|
||||||
<h>36</h>
|
<h>42</h>
|
||||||
</coordinates>
|
</coordinates>
|
||||||
<panel_attributes>lt=<..
|
<panel_attributes>lt=<..
|
||||||
1
|
1
|
||||||
|
|
||||||
</panel_attributes>
|
</panel_attributes>
|
||||||
<additional_attributes>10.0;40.0;10.0;10.0</additional_attributes>
|
<additional_attributes>10.0;50.0;10.0;10.0</additional_attributes>
|
||||||
</element>
|
</element>
|
||||||
<element>
|
<element>
|
||||||
<id>Relation</id>
|
<id>Relation</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>660</x>
|
<x>582</x>
|
||||||
<y>474</y>
|
<y>474</y>
|
||||||
<w>114</w>
|
<w>114</w>
|
||||||
<h>30</h>
|
<h>30</h>
|
||||||
@@ -230,7 +231,7 @@ m1=1
|
|||||||
<element>
|
<element>
|
||||||
<id>UMLClass</id>
|
<id>UMLClass</id>
|
||||||
<coordinates>
|
<coordinates>
|
||||||
<x>762</x>
|
<x>684</x>
|
||||||
<y>450</y>
|
<y>450</y>
|
||||||
<w>126</w>
|
<w>126</w>
|
||||||
<h>102</h>
|
<h>102</h>
|
||||||
|
|||||||
@@ -44,14 +44,13 @@ public class WordleServer extends Server {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processMessage(String pClientIP, int pClientPort, String pMessage) {
|
public void processMessage(String pClientIP, int pClientPort, String pMessage) {
|
||||||
String conectionID = pClientIP + ":" + Integer.toString(pClientPort);
|
String connectionID = pClientIP + ":" + Integer.toString(pClientPort);
|
||||||
User u = users.get(conectionID);
|
User u = users.get(connectionID);
|
||||||
|
u.setConnectionID(connectionID);
|
||||||
|
|
||||||
if (pMessage.equals("QUIT")) {
|
if (pMessage.equals("QUIT")) {
|
||||||
send(pClientIP, pClientPort, "+OK Bye");
|
send(pClientIP, pClientPort, "+OK Bye");
|
||||||
close();
|
close();
|
||||||
} else {
|
|
||||||
send(pClientIP, pClientPort, "-ERR Command not valid in this state");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (u.getState()) {
|
switch (u.getState()) {
|
||||||
@@ -61,13 +60,20 @@ public class WordleServer extends Server {
|
|||||||
if (m.equalsIgnoreCase("USER")) {
|
if (m.equalsIgnoreCase("USER")) {
|
||||||
m = pMessage.substring(6, pMessage.length() - 1);
|
m = pMessage.substring(6, pMessage.length() - 1);
|
||||||
u.setUsername(m);
|
u.setUsername(m);
|
||||||
send(pClientIP, pClientPort, "+OK Bye");
|
send(pClientIP, pClientPort, "+OK");
|
||||||
} else if (m.equalsIgnoreCase("PASS")) {
|
} else if (m.equalsIgnoreCase("PASS")) {
|
||||||
m = pMessage.substring(6, pMessage.length() - 1);
|
m = pMessage.substring(6, pMessage.length() - 1);
|
||||||
u.setPassword(m);
|
u.setPassword(m);
|
||||||
if (u.getPassword() != null && u.getUsername() != null) {
|
if (u.getPassword() != null && u.getUsername() != null) {
|
||||||
query.checkLogin(u.getUsername(), u.getPassword());
|
if (query.checkLogin(u.getUsername(), u.getPassword())) {
|
||||||
|
send(pClientIP, pClientPort, "+OK welcome");
|
||||||
|
u.setState(3);
|
||||||
|
} else {
|
||||||
|
send(pClientIP, pClientPort, "+ERR login not valid");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
send(pClientIP, pClientPort, "-ERR Command not valid in this state");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
|||||||
Reference in New Issue
Block a user