月度存档: 3月 2012

spring roo

1、下载spring roo

http://www.springsource.org/download/community?project=Spring%2520Roo

2、设置环境变量

ROO_HOME为安装目录

在PATH里添加%ROO_HOME%\bin

3、建立测试工程

mkdir hello
cd hello
roo
roo> hint
roo> project --topLevelPackage com.foo
roo> jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
roo> entity jpa --class ~.Timer --testAutomatically
roo> field string --fieldName message --notNull
roo> hint web mvc
roo> web mvc setup
roo> web mvc all --package ~.web
roo> selenium test --controller ~.web.TimerController
roo> web gwt setup
roo> perform tests
roo> quit

4、执行 mvn gwt:run 运行gwt客户端或者执行mvn tomcat:run 运行tomcat

 

另附一下spring roo的文档地址:

http://static.springsource.org/spring-roo/reference/html/index.html

java使用spring调用.NET的web service

最近和起点做对接,要求推送统计数据。

http://game.qidian.com/RemoteWebService/GameStats.asmx

这里起点的web service接口。

spring可以将web service包装为一个普通的service进行调用,非常方便。

<bean id=”qiDianManager”
class=”org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean”
lazy-init=”true”>
<property name=”wsdlDocumentUrl”
value=”http://game.qidian.com/RemoteWebService/GameStats.asmx?WSDL” />
<property name=”namespaceUri”
value=”http://tempuri.org/” />
<property name=”serviceInterface” value=”game.XXXX.XXXX.service.QiDianManager” />
<property name=”serviceName” value=”GameStats” />
<property name=”portName” value=”GameStatsSoap” />
<property name=”lookupServiceOnStartup” value=”false” />
</bean>

 

linux下查看每个文件夹的大小

du -h –max-depth=1

可以查看指定目录下的每个目录占用的空间大小。

 

gameobject find child gameobject

gameObject.transform.FindChild(“Name”).gameObject

真希望能找到一个更合适的方式。不过这样暂时也能解决问题了。

解决win7下unity卡的问题

 

点击“我的电脑”–>右键“属性”–>“高级系统设置”–>“高级”选项页中的“性能”设置->“数据执行保护”–>开启“为除下列选定程序之外的所有程序和服务启用DEP–>将unity.exe加入。

然后会提示重启电脑,重启后unity卡的问题即解决。

unity3d无法正常使用

不知道是哪个地方不兼容。

在我的x64 win7上,unity3d在脚本有改动时卡的要命,基本上需要几十秒后才会响应。

不得已,尝试在mac上看看有没有这种问题。

如果 还有这种问题,我是无解了。

今天下载unity3d for mac.

smartfoxserver学习二

前一篇学习了使用客户端连接server.

这次学习一下扩展server逻辑。

sfs server扩展仅支持java.

建立java工程后,将sfs2x.jar和sfs2x-core.jar导入。

BaseClientRequestHandler 用来处理一个客户端请求

BaseServerEventHandler 用来处理一个服务器端事件

 

smartfoxserver需要确认以下事项

1、需要确认sfs中的jar发布是否会引起游戏重启。

2、需要确认sfs是否支持class文件发布.

3、需要确认sfs中的class加载是否会引起游戏重启。

4、需要确认spring中加载动态语言是否会引起服务重新加载。

5、需要确认不同zone中的游戏数据是否会有影响。

6、同一个类的static属性在不同的zone中是否会被共享。

unity3d 学习日志(一)

Debug.Log(“hello”);

用来输出日志。

建立至server的连接

 

using UnityEngine;
using System.Collections;
using Sfs2X;
using Sfs2X.Logging;
using Sfs2X.Core;
using Sfs2X.Entities;
using Sfs2X.Requests;

public class NewBehaviourScript : MonoBehaviour {
SmartFox sf;

void Start () {
sf = new SmartFox(true);
sf.Debug = true;

Debug.Log(“hello”);

sf.AddEventListener(SFSEvent.CONNECTION, OnConnection);

sf.Connect(“127.0.0.1”,9933);
}
void FixedUpdate()
{
sf.ProcessEvents();// 这里用来处理事件,必不可少
}

// Update is called once per frame
public void OnConnection(BaseEvent evt)
{
Debug.Log(“in onConnection”);
}

}

c#自动代码提示

ctrl+J

自动代码提示。