Fixed a bug in server initialization related to serializer registration.
Lowered the logging level so that these both spew all of the lowest level network logging. Useful for seeing what's going on and finding issues.
This commit is contained in:
parent
57bcb3967f
commit
bdc3ff8434
@ -41,6 +41,8 @@ import java.awt.Component;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import jme3test.network.TestChatServer.ChatMessage;
|
import jme3test.network.TestChatServer.ChatMessage;
|
||||||
|
|
||||||
@ -115,6 +117,18 @@ public class TestChatClient extends JFrame {
|
|||||||
|
|
||||||
public static void main(String... args) throws Exception {
|
public static void main(String... args) throws Exception {
|
||||||
|
|
||||||
|
// Increate the logging level for networking...
|
||||||
|
System.out.println("Setting logging to max");
|
||||||
|
Logger networkLog = Logger.getLogger("com.jme3.network");
|
||||||
|
networkLog.setLevel(Level.FINEST);
|
||||||
|
|
||||||
|
// And we have to tell JUL's handler also
|
||||||
|
// turn up logging in a very convoluted way
|
||||||
|
Logger rootLog = Logger.getLogger("");
|
||||||
|
if( rootLog.getHandlers().length > 0 ) {
|
||||||
|
rootLog.getHandlers()[0].setLevel(Level.FINEST);
|
||||||
|
}
|
||||||
|
|
||||||
// Note: in JME 3.1 this is generally unnecessary as the server will
|
// Note: in JME 3.1 this is generally unnecessary as the server will
|
||||||
// send a message with all server-registered classes.
|
// send a message with all server-registered classes.
|
||||||
// TestChatServer.initializeClasses();
|
// TestChatServer.initializeClasses();
|
||||||
|
@ -31,6 +31,9 @@
|
|||||||
*/
|
*/
|
||||||
package jme3test.network;
|
package jme3test.network;
|
||||||
|
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import com.jme3.network.*;
|
import com.jme3.network.*;
|
||||||
import com.jme3.network.serializing.Serializable;
|
import com.jme3.network.serializing.Serializable;
|
||||||
import com.jme3.network.serializing.Serializer;
|
import com.jme3.network.serializing.Serializer;
|
||||||
@ -56,11 +59,15 @@ public class TestChatServer {
|
|||||||
private boolean isRunning;
|
private boolean isRunning;
|
||||||
|
|
||||||
public TestChatServer() throws IOException {
|
public TestChatServer() throws IOException {
|
||||||
initializeClasses();
|
|
||||||
|
|
||||||
// Use this to test the client/server name version check
|
// Use this to test the client/server name version check
|
||||||
this.server = Network.createServer(NAME, VERSION, PORT, UDP_PORT);
|
this.server = Network.createServer(NAME, VERSION, PORT, UDP_PORT);
|
||||||
|
|
||||||
|
// Initialize our own messages only after the server has been created.
|
||||||
|
// It registers some additional messages with the serializer by default
|
||||||
|
// that need to go before custom messages.
|
||||||
|
initializeClasses();
|
||||||
|
|
||||||
ChatHandler handler = new ChatHandler();
|
ChatHandler handler = new ChatHandler();
|
||||||
server.addMessageListener(handler, ChatMessage.class);
|
server.addMessageListener(handler, ChatMessage.class);
|
||||||
|
|
||||||
@ -122,6 +129,18 @@ public class TestChatServer {
|
|||||||
|
|
||||||
public static void main(String... args) throws Exception {
|
public static void main(String... args) throws Exception {
|
||||||
|
|
||||||
|
// Increate the logging level for networking...
|
||||||
|
System.out.println("Setting logging to max");
|
||||||
|
Logger networkLog = Logger.getLogger("com.jme3.network");
|
||||||
|
networkLog.setLevel(Level.FINEST);
|
||||||
|
|
||||||
|
// And we have to tell JUL's handler also
|
||||||
|
// turn up logging in a very convoluted way
|
||||||
|
Logger rootLog = Logger.getLogger("");
|
||||||
|
if( rootLog.getHandlers().length > 0 ) {
|
||||||
|
rootLog.getHandlers()[0].setLevel(Level.FINEST);
|
||||||
|
}
|
||||||
|
|
||||||
TestChatServer chatServer = new TestChatServer();
|
TestChatServer chatServer = new TestChatServer();
|
||||||
chatServer.start();
|
chatServer.start();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user