<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Shephertz Community - Recent questions in Java</title>
<link>http://forum.shephertz.com/?qa=questions/products/appwarp/java</link>
<description>Powered by Question2Answer</description>
<item>
<title>AppWarp Multiplayer Game. A lot of messages</title>
<link>http://forum.shephertz.com/?qa=11566/appwarp-multiplayer-game-a-lot-of-messages</link>
<description>&lt;p&gt;
	Hi.&lt;/p&gt;
&lt;div&gt;
	I successfully created a multiplayer demo game based on the example:&lt;br style=&quot;clear: both;&quot;&gt;
	&lt;div&gt;
		&lt;a href=&quot;http://appwarp.shephertz.com/game-development-center/java-multiplayer-libgdx-tutorial/&quot; rel=&quot;nofollow&quot; style=&quot;color: rgb(17, 85, 204);&quot; target=&quot;_blank&quot;&gt;http://appwarp.shephertz.com/game-development-center/java-multiplayer-libgdx-tutorial/&lt;/a&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		In my test app, I just connect two users to a room and one of them only sends one short message. Then both users leave the room.&amp;nbsp;I only did it once.&lt;/div&gt;
	&lt;div&gt;
		Then in the &lt;strong&gt;AppHQ &lt;/strong&gt;console, I see &lt;strong&gt;105&lt;/strong&gt; messages for my test app.&amp;nbsp;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;How is this possible?&lt;/span&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		I use&amp;nbsp;&lt;span style=&quot;color: rgb(51, 51, 51); font-family: Helvetica, Arial, Sens-serif; font-size: 14px;&quot;&gt;App42MultiPlayerGamingSDK.jar (version 2.3).&lt;/span&gt;&lt;/div&gt;
	&lt;div&gt;
		Code:&lt;/div&gt;
	&lt;div&gt;
		&lt;pre class=&quot;brush:java;&quot;&gt;
public void quickGame() {
    ...
    WarpClient.initialize(apiKey, secretKey);
    warpClient = WarpClient.getInstance();

    connectionListener = new ConnectionListener(this);
    roomListener = new RoomListener(this);
    zoneListener = new ZoneListener(this);
    notificationListener = new NotificationListener(this);

    warpClient.addConnectionRequestListener(connectionListener);
    warpClient.addRoomRequestListener(roomListener);
    warpClient.addZoneRequestListener(zoneListener);
    warpClient.addNotificationListener(notificationListener);

    warpClient.connectWithUserName(myId);
}

private void onConnectDone(boolean status) {
    ...
    warpClient.joinRoomWithProperties(properties);
}

private void onJoinRoomDone(RoomEvent event) {
    if (event.getResult() == WarpResponseResultCode.SUCCESS) {
        ...
        warpClient.subscribeRoom(roomId);
    } else if (event.getResult() == WarpResponseResultCode.RESOURCE_NOT_FOUND) {
        ...
        warpClient.createRoom(&quot;game&quot;, &quot;owner&quot;, 2, properties);
    }
}

private void onRoomCreated(String roomId){
    ...
    warpClient.joinRoom(roomId);
}

private void onRoomSubscribed(String roomId) {
    ...
    warpClient.getLiveRoomInfo(roomId);
}

public void sendMessage(byte[] msgBuf) {
    warpClient.sendPrivateUpdate(opponentId, msgBuf);
}

public void leaveGame() {
    ...
    warpClient.unsubscribeRoom(roomId);
    warpClient.leaveRoom(roomId);
    warpClient.deleteRoom(roomId);
    warpClient.removeConnectionRequestListener(connectionListener);
    warpClient.removeRoomRequestListener(roomListener);
    warpClient.removeZoneRequestListener(zoneListener);
    warpClient.removeNotificationListener(notificationListener);
    warpClient.disconnect();
}&lt;/pre&gt;
		&lt;p&gt;
			What am I doing wrong? How do I reduce the number of messages?&amp;nbsp;Does&amp;nbsp;App Configuration (&lt;strong&gt;Auto Recover Time&lt;/strong&gt;, Default Zone) affect the number of messages?&lt;/p&gt;
	&lt;/div&gt;
	&lt;div&gt;
		This may be a problem when choosing AppWarp to implement multiplayer in the release version of the game. Since it is not profitable. It is still more profitable to pay for &lt;strong&gt;CCU&lt;/strong&gt; than for the number of &lt;strong&gt;messages&lt;/strong&gt; that are not clearly counted.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Thanks.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;</description>
<category>Java</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=11566/appwarp-multiplayer-game-a-lot-of-messages</guid>
<pubDate>Tue, 31 Mar 2020 21:02:16 +0000</pubDate>
</item>
<item>
<title>How to terminate AppWarp thread after it's initialized?</title>
<link>http://forum.shephertz.com/?qa=11470/how-to-terminate-appwarp-thread-after-its-initialized</link>
<description>&lt;p&gt;
	Hi,&lt;/p&gt;
&lt;p&gt;
	Calling AppWarp.initialize creates a new thread:&lt;/p&gt;
&lt;pre class=&quot;brush:java;&quot;&gt;
            _instance.dispatcher = new MessageDispatchThread(_instance);
            _instance.dispatcher.start();&lt;/pre&gt;
&lt;p&gt;
	Is there a way to terminate this thread manually?&lt;/p&gt;
&lt;p&gt;
	Or when it should go down automatically, after disconnection perhaps?&lt;/p&gt;</description>
<category>Java</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=11470/how-to-terminate-appwarp-thread-after-its-initialized</guid>
<pubDate>Fri, 31 May 2019 18:01:15 +0000</pubDate>
</item>
<item>
<title>How to set different positions of players at start multiplayerGameScreen?</title>
<link>http://forum.shephertz.com/?qa=11466/different-positions-players-start-multiplayergamescreen</link>
<description>I Hi! I develop game by example &amp;quot;Java Multiplayer libgdx tutorial&amp;quot; SuperJumper game. I want to set different start position of players on the game screen? How do it? Thank you)</description>
<category>Java</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=11466/different-positions-players-start-multiplayergamescreen</guid>
<pubDate>Wed, 22 May 2019 19:28:15 +0000</pubDate>
</item>
<item>
<title>Ghost user in lobby</title>
<link>http://forum.shephertz.com/?qa=11337/ghost-user-in-lobby</link>
<description>&lt;p&gt;
	&lt;span style=&quot;caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-size-adjust: auto;&quot;&gt;It seems that I have an persistent ghost user in my lobby, for several weeks now. How can I unsubscribe him? Don’t you have something like a is-alive ping? How can this happen?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;span style=&quot;caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; text-size-adjust: auto;&quot;&gt;I implemented a lobby where you see subscribed online users to invite them for a private game.&lt;/span&gt;&lt;/p&gt;</description>
<category>Java</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=11337/ghost-user-in-lobby</guid>
<pubDate>Thu, 18 Oct 2018 20:51:42 +0000</pubDate>
</item>
<item>
<title>Missing clean up time in Java SDK</title>
<link>http://forum.shephertz.com/?qa=11251/missing-clean-up-time-in-java-sdk</link>
<description>The C# Client API, supports cleanupTime, this is exactly what I am looking for! Unfortunately Java SDK does not support this feature. Since cleanup should be handled on the server and not on the client. I am really wondering why it is not available for Java. Please help!</description>
<category>Java</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=11251/missing-clean-up-time-in-java-sdk</guid>
<pubDate>Sat, 04 Aug 2018 03:16:29 +0000</pubDate>
</item>
<item>
<title>How enable debug logging for app42 and appWarp?</title>
<link>http://forum.shephertz.com/?qa=11237/how-enable-debug-logging-for-app42-and-appwarp</link>
<description>How can I enable debug logging for app42 and appWarp on my client?</description>
<category>Java</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=11237/how-enable-debug-logging-for-app42-and-appwarp</guid>
<pubDate>Thu, 26 Jul 2018 07:30:46 +0000</pubDate>
</item>
<item>
<title>Global and Lobby Chat using AppWarp</title>
<link>http://forum.shephertz.com/?qa=10723/global-and-lobby-chat-using-appwarp</link>
<description>I was wondering if it is possible to implement different chats using AppWarp, between which the client can switch while playing a game.

For example, while being in a game room they would have the option to switch between global, private and lobby chats. How can I implement this using AppWarp?

Using the subscribe function does not let the user send messages to the room they subscribed to, it is restricted to only their current room.</description>
<category>Java</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=10723/global-and-lobby-chat-using-appwarp</guid>
<pubDate>Fri, 01 Sep 2017 07:35:57 +0000</pubDate>
</item>
<item>
<title>libGDX and HTML</title>
<link>http://forum.shephertz.com/?qa=10337/libgdx-and-html</link>
<description>Hi, I wondered if there was a way to have all my multiplayer code on the core module that works with HTML's libgdx. I tried just adding the appwarp jar as graddle dependency but it didn't work, since apparently u need the sources of the library for that. Do u provide the sources anywhere?</description>
<category>Java</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=10337/libgdx-and-html</guid>
<pubDate>Wed, 29 Mar 2017 20:27:52 +0000</pubDate>
</item>
<item>
<title>Matching: Roles and Partners</title>
<link>http://forum.shephertz.com/?qa=9986/matching-roles-and-partners</link>
<description>&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px;&quot;&gt;
	Sometimes, the same&amp;nbsp;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/nodeGame/nodegame/wiki/Client-Types-v3&quot; style=&quot;box-sizing: border-box; background-color: transparent; color: rgb(64, 120, 192); text-decoration: none;&quot;&gt;client type&lt;/a&gt;&amp;nbsp;in the same step should behave differently depending on the&amp;nbsp;&lt;em style=&quot;box-sizing: border-box;&quot;&gt;role&amp;nbsp;&lt;/em&gt;that each player&amp;nbsp; assumes in that particular game step.&lt;/p&gt;
&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px;&quot;&gt;
	For example, in an&amp;nbsp;&lt;a rel=&quot;nofollow&quot; href=&quot;https://en.wikipedia.org/wiki/Ultimatum_game&quot; style=&quot;box-sizing: border-box; background-color: transparent; color: rgb(64, 120, 192); text-decoration: none;&quot;&gt;ultimatum game&lt;/a&gt;, players are paired together, and in the same step one player is making an offer (role = 'BIDDER') and the other one is waiting to receive it (role = 'RESPONDENT').&lt;/p&gt;
&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;; font-size: 16px;&quot;&gt;
	Its possible to set role for a room like that?&lt;/p&gt;</description>
<category>Java</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=9986/matching-roles-and-partners</guid>
<pubDate>Fri, 23 Dec 2016 13:43:44 +0000</pubDate>
</item>
<item>
<title>Weird multiple connections</title>
<link>http://forum.shephertz.com/?qa=8527/weird-multiple-connections</link>
<description>&lt;p style=&quot;text-align: justify;&quot;&gt;
	Hi. Before i start i have to say that my english level isn't as good as many of you. So i apologise for that.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;
	I am making a videogame which have a real-time multiplayer mode. I have done this part recently.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;
	When it is the first time that the two devices connect to the server,&lt;strong&gt; they can play really nice and well&lt;/strong&gt;. Once one of them is defeated their screens go back to the main menu. Then&lt;strong&gt; when those two devices want to do another game&lt;/strong&gt; (quick game, random players)&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;strong&gt; things get really weird&lt;/strong&gt;&lt;/span&gt;.&lt;strong&gt; I'll explain what it does the first device that want to play another quick game.&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li style=&quot;text-align: justify;&quot;&gt;
			Tries to do 2 connections (like if they did a &quot;connectWithUserName&quot; twice. Totally impossible because it's in the constructor of the screen)&lt;/li&gt;
		&lt;li style=&quot;text-align: justify;&quot;&gt;
			Tries to connect 4 different rooms (totally weird), then creates those 4 rooms (the System.out.println show me that this occurs 4 times each room. -&amp;gt; 16 connections)&lt;/li&gt;
		&lt;li style=&quot;text-align: justify;&quot;&gt;
			Result -&amp;gt; 16 failed to getLiveUserInfo What am i doing wrong? I disconnected incorrectly from the server the previous time?&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;
	What i do to disconnect:&lt;/p&gt;
&lt;blockquote&gt;
	&lt;ul&gt;
		&lt;li style=&quot;text-align: justify;&quot;&gt;
			warpClient.leaveRoom()&lt;/li&gt;
		&lt;li style=&quot;text-align: justify;&quot;&gt;
			onLeaveRoomDone() -&amp;gt; warpClient.unSubscribeRoom()&lt;/li&gt;
		&lt;li style=&quot;text-align: justify;&quot;&gt;
			onUnSubscribeRoomDone() -&amp;gt; warpClient.disconnect()&lt;/li&gt;
		&lt;li style=&quot;text-align: justify;&quot;&gt;
			onDisconnectDone() -&amp;gt; disposeListeners()&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;
	Thanks.&lt;/p&gt;</description>
<category>Java</category>
<guid isPermaLink="true">http://forum.shephertz.com/?qa=8527/weird-multiple-connections</guid>
<pubDate>Wed, 06 Apr 2016 08:06:16 +0000</pubDate>
</item>
</channel>
</rss>