-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
411590d
commit ee1abaf
Showing
11 changed files
with
450 additions
and
43 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package net.tnemc.tnc.core.common.chat.db; | ||
|
||
/** | ||
* Created by creatorfromhell on 3/18/2018. | ||
* <p> | ||
* The New Chat Minecraft Server Plugin | ||
* <p> | ||
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. | ||
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to | ||
* Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. | ||
*/ | ||
public interface DataProvider { | ||
|
||
String getDriver(); | ||
Boolean dataSource(); | ||
String dataSourceURL(); | ||
String getURL(String file, String host, int port, String database); | ||
|
||
default void preConnect(String file, String host, int port, String database) { | ||
|
||
} | ||
} |
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 net.tnemc.tnc.core.common.chat.db; | ||
|
||
import org.javalite.activejdbc.Model; | ||
import org.javalite.activejdbc.annotations.CompositePK; | ||
import org.javalite.activejdbc.annotations.DbName; | ||
import org.javalite.activejdbc.annotations.Table; | ||
|
||
import java.util.UUID; | ||
|
||
/** | ||
* Created by creatorfromhell. | ||
* | ||
* The New VPN Blocker Minecraft Server Plugin | ||
* | ||
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 | ||
* International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ | ||
* or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. | ||
*/ | ||
@DbName("TNC") | ||
@Table("tnc_ignored") | ||
@CompositePK({ "uuid", "channel" }) | ||
public class IgnoredChannel extends Model { | ||
|
||
public static boolean add(UUID id, String channel) { | ||
IgnoredChannel chan = (exists(id, channel))? getChannel(id, channel) : new IgnoredChannel(); | ||
chan.set("uuid", id.toString()); | ||
chan.set("channel", channel); | ||
|
||
return chan.saveIt(); | ||
} | ||
|
||
public static boolean exists(UUID id, String channel) { | ||
return getChannel(id, channel) != null; | ||
} | ||
|
||
public static IgnoredChannel getChannel(UUID id, String channel) { | ||
return IgnoredChannel.findFirst("uuid = ? AND channel = ?", id.toString(), channel); | ||
} | ||
|
||
public static void delete(UUID id, String channel) { | ||
IgnoredChannel.delete("uuid = ? AND channel = ?", id.toString(), channel); | ||
} | ||
} |
Oops, something went wrong.