Skip to content

Commit dfb02c6

Browse files
author
Lucas
committed
Added comments and Result fields to most commonly types of data
1 parent 5fcf8ec commit dfb02c6

File tree

8 files changed

+151
-56
lines changed

8 files changed

+151
-56
lines changed

.classpath

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
33
<classpathentry kind="src" path="src/main/java"/>
4-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" exported="true"/>
5-
<classpathentry kind="output" path="bin"/>
6-
<classpathentry sourcepath="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/org.ini4j/ini4j/0.5.2/17a383f897ae0ec8fca2f3effc2a2b8dbb336fc2/ini4j-0.5.2-sources.jar" kind="lib" path="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/org.ini4j/ini4j/0.5.2/16561cb11c221b5928119e10d7636c95ee5c960d/ini4j-0.5.2.jar" exported="true"/>
7-
<classpathentry kind="lib" path="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/mysql/mysql-connector-java/5.1.6/380ef5226de2c85ff3b38cbfefeea881c5fce09d/mysql-connector-java-5.1.6.jar" exported="true"/>
8-
<classpathentry sourcepath="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/junit/junit/4.11/28e0ad201304e4a4abf999ca0570b7cffc352c3c/junit-4.11-sources.jar" kind="lib" path="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/junit/junit/4.11/4e031bb61df09069aeb2bffb4019e7a5034a4ee0/junit-4.11.jar" exported="true"/>
9-
<classpathentry sourcepath="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b/hamcrest-core-1.3-sources.jar" kind="lib" path="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar" exported="true"/>
4+
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5+
<classpathentry exported="true" kind="lib" path="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/org.ini4j/ini4j/0.5.2/16561cb11c221b5928119e10d7636c95ee5c960d/ini4j-0.5.2.jar" sourcepath="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/org.ini4j/ini4j/0.5.2/17a383f897ae0ec8fca2f3effc2a2b8dbb336fc2/ini4j-0.5.2-sources.jar"/>
6+
<classpathentry exported="true" kind="lib" path="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/mysql/mysql-connector-java/5.1.6/380ef5226de2c85ff3b38cbfefeea881c5fce09d/mysql-connector-java-5.1.6.jar"/>
7+
<classpathentry exported="true" kind="lib" path="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/junit/junit/4.11/4e031bb61df09069aeb2bffb4019e7a5034a4ee0/junit-4.11.jar" sourcepath="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/junit/junit/4.11/28e0ad201304e4a4abf999ca0570b7cffc352c3c/junit-4.11-sources.jar"/>
8+
<classpathentry exported="true" kind="lib" path="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar" sourcepath="C:/Users/Łukasz/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b/hamcrest-core-1.3-sources.jar"/>
9+
<classpathentry kind="output" path="build"/>
1010
</classpath>

.gitattributes

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ hs_err_pid*
1313
build/
1414
bin/
1515
.gradle/
16-
/.settings/
16+
.settings/

src/main/java/pl/grm/boll/lib/LauncherDB.java

+39-6
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,47 @@
33
import java.rmi.Remote;
44
import java.rmi.RemoteException;
55

6+
/**
7+
* Interface which extend Remote of RMI controller to game BOL.
8+
*/
69
public interface LauncherDB extends Remote {
10+
/**
11+
* Ensures that in database is @param login. If exists than will
12+
* return the same name from database in Result->String.
13+
* <p>
14+
* If not it will be empty.
15+
* <p>
16+
* If there will be an exception than Result->exception would be not null.
17+
*
18+
* @return {@link Result}
19+
*/
20+
public Result checkIfExists(String login) throws RemoteException;
721

8-
public Result checkIfExists(String str) throws RemoteException;
22+
/**
23+
* Compare @param login and @param password and
24+
*
25+
* @return {@link Result} with boolean true if both params are equal.
26+
* @throws RemoteException
27+
*/
28+
public Result checkPasswd(String login, String password) throws RemoteException;
929

10-
public Result checkPasswd(String str, String str2) throws RemoteException;
11-
12-
public Result checkIfActivated(String str) throws RemoteException;
13-
14-
public Player getPlayerData(String str) throws RemoteException;
30+
/**
31+
* Checks if account is activated.
32+
*
33+
* @param login
34+
* @return {@link Result} boolean field true if activated.
35+
* @throws RemoteException
36+
*/
37+
public Result checkIfActivated(String login) throws RemoteException;
1538

39+
/**
40+
* Not implemented yet!
41+
* <p>
42+
* Downloads all player data from DB.
43+
*
44+
* @param login
45+
* @return {@link Player}
46+
* @throws RemoteException
47+
*/
48+
public Player getPlayerData(String login) throws RemoteException;
1649
}

src/main/java/pl/grm/boll/lib/Player.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
import java.io.Serializable;
44

55
public class Player implements Serializable {
6-
6+
private String playerName;
7+
private int level;
8+
private double exp;
9+
private Position position;
10+
private PlayerConfiguration pConfiguration;
711
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package pl.grm.boll.lib;
2+
3+
import java.io.Serializable;
4+
5+
public class PlayerConfiguration implements Serializable {
6+
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package pl.grm.boll.lib;
2+
3+
import java.io.Serializable;
4+
5+
public class Position implements Serializable {
6+
7+
}

src/main/java/pl/grm/boll/lib/Result.java

+64-42
Original file line numberDiff line numberDiff line change
@@ -3,64 +3,86 @@
33
import java.io.Serializable;
44

55
public class Result implements Serializable {
6-
private boolean conn_established = false;
76
/** Type of query listed in LauncherDB starting from 1 */
8-
private byte RESULT_TYPE = 0;
9-
private String resultString = null;
10-
private int resultInt = 0;
11-
private Exception e;
12-
private Boolean truefalse = false;
13-
7+
private byte RESULT_TYPE = 0;
8+
private Exception exception;
9+
private String resultString;
10+
private int resultInt;
11+
private long resultLong;
12+
private float resultFloat;
13+
private double resutDouble;
14+
private boolean resultBoolean;
15+
private int[] resultIntArray;
16+
1417
public Result(int i) {
1518
this.RESULT_TYPE = Byte.parseByte(Integer.toString(i));
1619
}
17-
18-
public boolean isConn_established() {
19-
return this.conn_established;
20+
21+
public synchronized Exception getException() {
22+
return this.exception;
2023
}
21-
22-
public void setConn_established(boolean conn_established) {
23-
this.conn_established = conn_established;
24+
25+
public synchronized void setException(Exception exception) {
26+
this.exception = exception;
2427
}
25-
26-
public byte getRESULT_TYPE() {
27-
return this.RESULT_TYPE;
28-
}
29-
30-
public void setRESULT_TYPE(byte rESULT_TYPE) {
31-
this.RESULT_TYPE = rESULT_TYPE;
32-
}
33-
34-
public String getResultString() {
28+
29+
public synchronized String getResultString() {
3530
return this.resultString;
3631
}
37-
38-
public void setResultString(String resultString) {
32+
33+
public synchronized void setResultString(String resultString) {
3934
this.resultString = resultString;
4035
}
41-
42-
public int getResultInt() {
36+
37+
public synchronized int getResultInt() {
4338
return this.resultInt;
4439
}
45-
46-
public void setResultInt(int resultInt) {
40+
41+
public synchronized void setResultInt(int resultInt) {
4742
this.resultInt = resultInt;
4843
}
49-
50-
public Exception getE() {
51-
return this.e;
44+
45+
public synchronized long getResultLong() {
46+
return this.resultLong;
5247
}
53-
54-
public void setE(Exception e) {
55-
this.e = e;
48+
49+
public synchronized void setResultLong(long resultLong) {
50+
this.resultLong = resultLong;
5651
}
57-
58-
public Boolean getTruefalse() {
59-
return truefalse;
52+
53+
public synchronized float getResultFloat() {
54+
return this.resultFloat;
6055
}
61-
62-
public void setTruefalse(Boolean truefalse) {
63-
this.truefalse = truefalse;
56+
57+
public synchronized void setResultFloat(float resultFloat) {
58+
this.resultFloat = resultFloat;
59+
}
60+
61+
public synchronized double getResutDouble() {
62+
return this.resutDouble;
63+
}
64+
65+
public synchronized void setResutDouble(double resutDouble) {
66+
this.resutDouble = resutDouble;
67+
}
68+
69+
public synchronized boolean isResultBoolean() {
70+
return this.resultBoolean;
71+
}
72+
73+
public synchronized void setResultBoolean(boolean resultBoolean) {
74+
this.resultBoolean = resultBoolean;
75+
}
76+
77+
public synchronized int[] getResultIntArray() {
78+
return this.resultIntArray;
79+
}
80+
81+
public synchronized void setResultIntArray(int[] resultIntArray) {
82+
this.resultIntArray = resultIntArray;
83+
}
84+
85+
public synchronized byte getRESULT_TYPE() {
86+
return this.RESULT_TYPE;
6487
}
65-
6688
}

0 commit comments

Comments
 (0)