-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/Cardshifter/Cardshifter …
…into ecs-module-support
- Loading branch information
Showing
125 changed files
with
3,762 additions
and
1,385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
cardshifter-api/src/main/java/com/cardshifter/api/CardshifterConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.cardshifter.api; | ||
|
||
public class CardshifterConstants { | ||
|
||
public static final String VANILLA = "VANILLA"; | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
cardshifter-api/src/main/java/com/cardshifter/api/both/ChatMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.cardshifter.api.both; | ||
|
||
import com.cardshifter.api.messages.Message; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
|
||
|
||
public class ChatMessage extends Message { | ||
|
||
private final int chatId; | ||
private final String message; | ||
private final String from; | ||
|
||
@JsonCreator | ||
ChatMessage() { | ||
this(0, "", ""); | ||
} | ||
|
||
public ChatMessage(int chatId, String from, String message) { | ||
super("chat"); | ||
this.chatId = chatId; | ||
this.from = from; | ||
this.message = message; | ||
} | ||
|
||
public int getChatId() { | ||
return chatId; | ||
} | ||
|
||
public String getFrom() { | ||
return from; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ChatMessage [chatId=" + chatId + ", message=" + message | ||
+ ", from=" + from + "]"; | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
cardshifter-api/src/main/java/com/cardshifter/api/both/InviteRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.cardshifter.api.both; | ||
|
||
import com.cardshifter.api.messages.Message; | ||
|
||
public class InviteRequest extends Message { | ||
|
||
private final int id; | ||
private final String name; | ||
|
||
InviteRequest() { | ||
this(0, ""); | ||
} | ||
public InviteRequest(int id, String name) { | ||
super("inviteRequest"); | ||
this.id = id; | ||
this.name = name; | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
cardshifter-api/src/main/java/com/cardshifter/api/both/InviteResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.cardshifter.api.both; | ||
|
||
import com.cardshifter.api.messages.Message; | ||
|
||
public class InviteResponse extends Message { | ||
|
||
private final int inviteId; | ||
private final boolean accepted; | ||
|
||
InviteResponse() { | ||
this(0, false); | ||
} | ||
|
||
public InviteResponse(int inviteId, boolean accepted) { | ||
super("inviteResponse"); | ||
this.inviteId = inviteId; | ||
this.accepted = accepted; | ||
} | ||
|
||
public int getInviteId() { | ||
return inviteId; | ||
} | ||
|
||
public boolean isAccepted() { | ||
return accepted; | ||
} | ||
|
||
} |
13 changes: 0 additions & 13 deletions
13
cardshifter-api/src/main/java/com/cardshifter/api/incoming/ChatMessage.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
cardshifter-api/src/main/java/com/cardshifter/api/incoming/PlayCardMessage.java
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
cardshifter-api/src/main/java/com/cardshifter/api/incoming/ServerQueryMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.cardshifter.api.incoming; | ||
|
||
import com.cardshifter.api.messages.Message; | ||
|
||
public class ServerQueryMessage extends Message { | ||
|
||
public enum Request { | ||
USERS; | ||
} | ||
|
||
private final Request request; | ||
|
||
ServerQueryMessage() { | ||
this(Request.USERS); | ||
} | ||
public ServerQueryMessage(Request request) { | ||
super("query"); | ||
this.request = request; | ||
} | ||
|
||
public Request getRequest() { | ||
return request; | ||
} | ||
|
||
} |
21 changes: 20 additions & 1 deletion
21
cardshifter-api/src/main/java/com/cardshifter/api/incoming/StartGameRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,30 @@ | ||
package com.cardshifter.api.incoming; | ||
|
||
import com.cardshifter.api.messages.Message; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
|
||
public class StartGameRequest extends Message { | ||
|
||
public StartGameRequest() { | ||
private final int opponent; | ||
private final String gameType; | ||
|
||
@JsonCreator | ||
StartGameRequest() { | ||
this(-1, ""); | ||
} | ||
|
||
public StartGameRequest(int opponent, String gameType) { | ||
super("startgame"); | ||
this.opponent = opponent; | ||
this.gameType = gameType; | ||
} | ||
|
||
public int getOpponent() { | ||
return opponent; | ||
} | ||
|
||
public String getGameType() { | ||
return gameType; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.