Auth Object
This commit is contained in:
		
							parent
							
								
									8ec66238aa
								
							
						
					
					
						commit
						68dd59b519
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -87,3 +87,4 @@ crashlytics.properties | |||||||
| crashlytics-build.properties | crashlytics-build.properties | ||||||
| fabric.properties | fabric.properties | ||||||
| # Created by .ignore support plugin (hsz.mobi) | # Created by .ignore support plugin (hsz.mobi) | ||||||
|  | /target/ | ||||||
|  | |||||||
							
								
								
									
										13
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								pom.xml
									
									
									
									
									
								
							| @ -8,6 +8,18 @@ | |||||||
|     <artifactId>teamspeak</artifactId> |     <artifactId>teamspeak</artifactId> | ||||||
|     <version>1.0-SNAPSHOT</version> |     <version>1.0-SNAPSHOT</version> | ||||||
| 
 | 
 | ||||||
|  |    <organization> | ||||||
|  |     	<name>Tysox.de</name> | ||||||
|  |     	<url>tysox.de</url> | ||||||
|  |     </organization> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 	<developers> | ||||||
|  | 		<developer> | ||||||
|  | 			<name>Jan-Lukas Pagel</name> | ||||||
|  | 			<email>jan-lukas.pagel@tysox.de</email> | ||||||
|  | 		</developer> | ||||||
|  | 	</developers> | ||||||
| 
 | 
 | ||||||
|     <repositories> |     <repositories> | ||||||
|         <repository> |         <repository> | ||||||
| @ -82,4 +94,5 @@ | |||||||
|         </plugins> |         </plugins> | ||||||
|     </build> |     </build> | ||||||
| 
 | 
 | ||||||
|  |   | ||||||
| </project> | </project> | ||||||
|  | |||||||
| @ -6,7 +6,7 @@ import java.io.File; | |||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Created by jan on 25.07.16. |  * Created by Jan-Lukas Pagel on 25.07.16. | ||||||
|  * |  * | ||||||
|  * @version 4.0 |  * @version 4.0 | ||||||
|  */ |  */ | ||||||
|  | |||||||
| @ -1,6 +1,9 @@ | |||||||
| package cf.semikolon.teamspeak.query; | package cf.semikolon.teamspeak.query; | ||||||
| 
 | 
 | ||||||
| import cf.semikolon.teamspeak.MainClass; | import cf.semikolon.teamspeak.MainClass; | ||||||
|  | import cf.semikolon.teamspeak.Messages; | ||||||
|  | import cf.semikolon.teamspeak.objects.Authentication; | ||||||
|  | 
 | ||||||
| import com.github.theholywaffle.teamspeak3.api.TextMessageTargetMode; | import com.github.theholywaffle.teamspeak3.api.TextMessageTargetMode; | ||||||
| import com.github.theholywaffle.teamspeak3.api.event.*; | import com.github.theholywaffle.teamspeak3.api.event.*; | ||||||
| import org.bukkit.Bukkit; | import org.bukkit.Bukkit; | ||||||
| @ -30,8 +33,21 @@ public class QueryEvents implements TS3Listener { | |||||||
|                     Player player = Bukkit.getPlayer(mcNick); |                     Player player = Bukkit.getPlayer(mcNick); | ||||||
|                     if (player != null) { |                     if (player != null) { | ||||||
|                         String authKey = MainClass.getInstance().getRandomString().nextString(); |                         String authKey = MainClass.getInstance().getRandomString().nextString(); | ||||||
|                         player.sendMessage("§9[TeamSpeakAuth] §7Dein Verifizierungscode:" + authKey); |                         Authentication authentication = new Authentication(player.getUniqueId(), authKey); | ||||||
|  |                         player.sendMessage(Messages.PREFIX + String.format(Messages.YOUR_VERIFY_CODE, authKey)); | ||||||
|  |                         MainClass.getInstance().getServerQuery().getApi().sendPrivateMessage(textMessageEvent.getInvokerId(), "Sie haben nun in Minecraft eine VerifizierungsNummer erhalten"); | ||||||
|  |                          | ||||||
|  |                     } else { | ||||||
|  |                     	/** | ||||||
|  |                     	 * Spieler nicht Online | ||||||
|  |                     	 */ | ||||||
|  |                     	 | ||||||
|                     } |                     } | ||||||
|  |                 } else { | ||||||
|  |                 	/** | ||||||
|  |                 	 * Keine korrekte Syntax | ||||||
|  |                 	 */ | ||||||
|  |     | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -17,7 +17,6 @@ public class ServerQuery { | |||||||
|     public ServerQuery(String host, int queryPort, int tsPort, String queryUser, String queryPassword, String nickname) { |     public ServerQuery(String host, int queryPort, int tsPort, String queryUser, String queryPassword, String nickname) { | ||||||
|         this.tsconfig.setHost(host); |         this.tsconfig.setHost(host); | ||||||
|         this.tsconfig.setQueryPort(queryPort); |         this.tsconfig.setQueryPort(queryPort); | ||||||
|         this.tsconfig.setDebugLevel(Level.ALL); |  | ||||||
|         this.query = new TS3Query(tsconfig); |         this.query = new TS3Query(tsconfig); | ||||||
|         this.query.connect(); |         this.query.connect(); | ||||||
|         System.out.println("Successfully connected to TeamSpeak!\n Logging in..."); |         System.out.println("Successfully connected to TeamSpeak!\n Logging in..."); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 71616
						71616