Skip to content

Commit

Permalink
* MyRoom tunnel communication bug
Browse files Browse the repository at this point in the history
* LogViewer scroll bug when filled
* SSID scan auto start
* Chat presets
* WlanProxy added
  • Loading branch information
monte committed May 31, 2011
1 parent 404910c commit 461b9c2
Show file tree
Hide file tree
Showing 53 changed files with 2,595 additions and 573 deletions.
21 changes: 19 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</mapper>
</pathconvert>

<target name="jar" depends="jar-lib, jar-swt, jar-portal, jar-room, jar-search, jar-lobby, jar-allinone">
<target name="jar" depends="jar-lib, jar-swt, jar-swt-proxy, jar-portal, jar-room, jar-search, jar-lobby, jar-allinone">
</target>

<target name="jar-lib">
Expand All @@ -46,14 +46,31 @@
</target>

<target name="jar-swt">
<jar basedir="bin" jarfile="${publish_directory}/PlayClient.jar" includes="pspnetparty/client/swt/**">
<jar jarfile="${publish_directory}/PlayClient.jar">
<fileset dir="bin" includes="pspnetparty/client/swt/**">
<exclude name="pspnetparty/client/swt/app/**" />
</fileset>
<manifest>
<attribute name="Main-Class" value="pspnetparty.client.swt.PlayClient" />
<attribute name="Class-Path" value="PspNetParty.jar ${manifest.classpath.swt}" />
</manifest>
</jar>
</target>

<target name="jar-swt-proxy">
<jar jarfile="${publish_directory}/WlanProxy.jar">
<fileset dir="bin">
<include name="pspnetparty/client/swt/SwtUtils*" />
<include name="pspnetparty/client/swt/WlanProxyConstants*" />
<include name="pspnetparty/client/swt/app/WlanProxy*" />
</fileset>
<manifest>
<attribute name="Main-Class" value="pspnetparty.client.swt.app.WlanProxyApp" />
<attribute name="Class-Path" value="PspNetParty.jar ${manifest.classpath.swt}" />
</manifest>
</jar>
</target>

<target name="jar-portal">
<jar basedir="bin" jarfile="${publish_directory}/PortalServer.jar" includes="pspnetparty/server/PortalServer*">
<manifest>
Expand Down
134 changes: 134 additions & 0 deletions src/pspnetparty/client/swt/ConnectAddressDialog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*
Copyright (C) 2011 monte
This file is part of PSP NetParty.
PSP NetParty is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package pspnetparty.client.swt;

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.Text;

import pspnetparty.lib.socket.TransportLayer;

public class ConnectAddressDialog extends Dialog {

private TransportLayer transport;
private String hostname;
private int port;

protected ConnectAddressDialog(Shell parentShell) {
super(parentShell);
}

@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText("アドレスを入力してください");
}

@Override
protected Control createDialogArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(4, false));
composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

GridData gridData;

{
Label label = new Label(composite, SWT.NONE);
label.setText("接続先のアドレス:");
label.setLayoutData(new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false, 4, 1));
}
{
Combo transportCombo = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
transportCombo.add("TCP");
transportCombo.add("UDP");
transportCombo.select(0);

transport = TransportLayer.TCP;

transportCombo.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event e) {
Combo transportCombo = (Combo) e.widget;
switch (transportCombo.getSelectionIndex()) {
case 0:
transport = TransportLayer.TCP;
break;
case 1:
transport = TransportLayer.UDP;
break;
}
}
});
}
{
Text hostnameText = new Text(composite, SWT.BORDER | SWT.SINGLE);
hostnameText.setText(hostname = "");

gridData = new GridData(GridData.FILL, GridData.CENTER, true, false);
gridData.minimumWidth = 100;
hostnameText.setLayoutData(gridData);

hostnameText.setFocus();
}
{
Label label = new Label(composite, SWT.NONE);
label.setText(":");
}
{
Spinner portSpinner = new Spinner(composite, SWT.BORDER);
portSpinner.setMinimum(1);
portSpinner.setMaximum(65535);
portSpinner.setSelection(port = 20000);

portSpinner.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
Spinner portSpinner = (Spinner) e.widget;
port = portSpinner.getSelection();
}
});
}

return composite;
}

public TransportLayer getTransport() {
return transport;
}

public String getHostName() {
return hostname;
}

public int getPort() {
return port;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.io.IOException;
import java.net.InetSocketAddress;
import java.text.SimpleDateFormat;

import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.custom.StyledText;
Expand All @@ -15,11 +14,15 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

import pspnetparty.client.swt.config.IPreferenceNodeProvider;
import pspnetparty.client.swt.config.IniAppData;
import pspnetparty.client.swt.config.IniAppearance;
import pspnetparty.client.swt.config.IniSettings;
import pspnetparty.client.swt.message.ErrorLog;
import pspnetparty.lib.IniSection;
import pspnetparty.lib.socket.IProtocol;

public interface IApplication {
public interface IPlayClient {
enum FontType {
GLOBAL, LOG, CHAT,
}
Expand All @@ -28,8 +31,6 @@ enum ColorType {
BACKGROUND, FOREGROUND, LOG_BACKGROUND,
}

public final SimpleDateFormat LOG_DATE_FORMAT = new SimpleDateFormat("HH:mm:ss");

interface PortalQuery {
public String getCommand();

Expand Down Expand Up @@ -58,6 +59,8 @@ interface PortalQuery {

public LogWindow getLogWindow();

public void addConfigPageProvider(IPreferenceNodeProvider provider);

public void openConfigDialog();

public void initControl(Control control);
Expand Down
8 changes: 5 additions & 3 deletions src/pspnetparty/client/swt/LobbyWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;

import pspnetparty.client.swt.IApplication.PortalQuery;
import pspnetparty.client.swt.IPlayClient.PortalQuery;
import pspnetparty.client.swt.config.IniAppData;
import pspnetparty.client.swt.config.IniSettings;
import pspnetparty.client.swt.message.AdminNotify;
import pspnetparty.client.swt.message.Chat;
import pspnetparty.client.swt.message.ErrorLog;
Expand Down Expand Up @@ -88,7 +90,7 @@ enum SessionState {
private String loginUserName;
private long lastLobbyActivity = 0L;

private IApplication application;
private IPlayClient application;

private Shell shell;
private boolean isActive;
Expand All @@ -109,7 +111,7 @@ enum SessionState {

private HashSet<IMessageListener> messageListeners = new HashSet<IMessageListener>();

public LobbyWindow(IApplication application) {
public LobbyWindow(IPlayClient application) {
this.application = application;

// Shell parentShell = application.getShell();
Expand Down
11 changes: 6 additions & 5 deletions src/pspnetparty/client/swt/LogWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

import pspnetparty.client.swt.config.IniAppData;
import pspnetparty.lib.Utility;

public class LogWindow {

private IApplication application;
private IPlayClient application;
private Shell shell;
private Text logText;

public LogWindow(IApplication application, Shell parentShell) {
public LogWindow(IPlayClient application, Shell parentShell) {
this.application = application;

// shell = new Shell((Shell) null, SWT.SHELL_TRIM | SWT.TOOL);
Expand Down Expand Up @@ -97,7 +98,7 @@ public void setVisible(boolean visible) {
shell.setVisible(visible);
}

public void appendLogTo(final String message, final boolean timestamp, final boolean showWindow) {
public void appendLog(final String message, final boolean timestamp, final boolean showWindow) {
if (Utility.isEmpty(message))
return;

Expand All @@ -106,7 +107,7 @@ public void appendLogTo(final String message, final boolean timestamp, final boo
SwtUtils.DISPLAY.asyncExec(new Runnable() {
@Override
public void run() {
appendLogTo(message, timestamp, showWindow);
appendLog(message, timestamp, showWindow);
}
});
return;
Expand All @@ -117,7 +118,7 @@ public void run() {

if (timestamp) {
Date now = new Date();
logText.append(IApplication.LOG_DATE_FORMAT.format(now));
logText.append(SwtUtils.LOG_DATE_FORMAT.format(now));
logText.append(" - ");
}

Expand Down
4 changes: 2 additions & 2 deletions src/pspnetparty/client/swt/MultiLineChatDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@

public class MultiLineChatDialog extends Dialog {

private IApplication application;
private IPlayClient application;
private Text inputText;

private String message;

protected MultiLineChatDialog(Shell parentShell, IApplication application) {
protected MultiLineChatDialog(Shell parentShell, IPlayClient application) {
super(parentShell);
this.application = application;
setShellStyle(getShellStyle() | SWT.RESIZE);
Expand Down
Loading

0 comments on commit 461b9c2

Please sign in to comment.