2008/12/24

Good webSite

一個服飾拖拉的網站
http://img.roiworld.com/data/roigame/our/swf/ou024.swf

2008/10/6

ElectroServer

ElectroServer 中
extension 指的是擴充套件
一個extension其下可能由很多plug-in組成

在server 的運作當作,可能一個extension中的某一個plug-in重覆的執行

如 我們可以同時讓一個plugin以不同名字的server side plugin的方式執行

plug-in的handle名稱是相同的
Plugin Name 則是不同的,以此區隔

2008/10/5

ElectroServer訊息大小的問題


今天發現了一個問題
應該說之前有很多原因都是卡在這

ElectroServer 傳給client的訊息是有大小限制的
預設是8192個char,也就是8192byte

感覺蠻小的,隨便從資料庫取資料就超過了

可以透過管理介面中的server setting中修改
maximun inbound message length
maximun outbound message length

不曉得electroserver的過程中是使用那種模式
如果是用XML傳,還蠻浪費頻寬的

2008/9/22

ManagedObjectFactory

ManagedObjectFactory

A managed object factory is a special case object that can be used to create objects that need to be tracked over time. Any piece of code in an extension can call a managed object factory and request or return an object to it. An excellent use for managed object factories is accessing a database connection pool. In this case, the connection itself is the managed object and the factory is the pool manager

ManagedObjectFactoryLifeCycle

2008/9/18

cancelScheduledExecution,排程

cancelScheduledExecution

int scheduleExecutionFromScript(int interval, int numberOfTimes, String callbackName)

伺服器端的排程執行程式,
interval,執行間隔,以千分之一秒為單位
numerOfTimes,次數,-1代表無限次
callbackName,所要執行的方法

另外,可以透過cancelScheduledExecution方法取消

詳細請參考 http://www.electro-server.com/documentation/docs/es4/server/extension/com/electrotank/electroserver4/extensions/api/ElectroServerApi.html#cancelScheduledExecution(int)

ElectroServer 從plug-in 送訊息給使用者

給使用者

EsObject message = new EsObject();
message.setString( TAG_ACTION, TAG_ACTION_CURRENTSTATE);
message.setInteger( TAG_GAMESTATE , gameState);
message.setInteger( TAG_TIME_LEFT, nextEvent - tickerCount );

//發訊訊息
getApi().sendPluginMessageToUser( userName , message );

給room全體

// tell players to start the countdown
EsObject message = new EsObject();
message.setString(TAG_ACTION, TAG_ACTION_COUNTDOWN);
message.setInteger(TAG_TIME_LEFT, nextEvent - tickerCount);
getApi().sendPluginMessageToRoom(getApi().getZoneId(),
getApi().getRoomId(), message);

2008/9/17

ElectroServer Game Manger

Game Type

GameConfiguration

2008/8/27

Event Handlers

Event handlers are used to implement specific code. All of the available event handlers are covered in the following sections.

Login Event Handler 登入事件

當使用者登入系統時發出,提供完整資訊給開發人員管理使用者登入的情形。可與Multiple login event handler同時執行。 login event handler有能力阻止使用者登入

在LoginEventHandler範例中,使用者連線到伺服器後,並為進入遊戲,透過伺才器幫使用者設定完成。

A login event handler is used to provide custom logic during the login process. The login event handler is designed to allow a developer complete control over how a user logs into the server. Multiple login event handlers can be tied to the server at one time. The order in which they are specified dictates their execution order. Each login event handler has the ability to fail the login at any time. A very common use for a login event handler is to look up a username and password in the database before letting the user login to the server.

See LoginEventHandler in the installation directory/server/examples folder for an example. After creating a login event handler, you will need to use the web admin to add it as a server level component of the extension it is in.

Note that during the executeLogin method, the user is not yet logged in, and not yet in a room. If you need to set a user server variable or permission set for this user, you will need to set it in the context variable.

BaseLoginEventHandler 在doc上的解釋

Custom login event handler. Implement this class, overriding the executeLogin method, and use as a server extension to customize logins. See the LoginEventHandler example plug-in.

Logout Event Handler 登出事件

A logout event handler is used to execute code when the user logs out or disconnects from the server. Unlike the login event handler, these do not work in a chain. Each one is fired in the order specified but with no ties to their peer handlers. A common use for a logout event handler is to track the time the user spent logged in by updating a database with the exit time.

User Variable Event Handler 使用者變數事件

A user variable event handler is used to listen for changes to user variables. It has the ability to perform an action when a user variable is updated, deleted, or created. A good use for this type of handler is to persist the variable to a database table so when a user next logs in, a login event handler can automatically create the user variables for the user.

Buddy List Event Handler

buddy list event handle是用於執行自定羅輯 當使用者新增移除或更新buddy。
與user variable event handler類似,通常用於儲存資料到資料庫中

A buddy list event handler is used to execute custom logic when a user adds, removes, or updates a buddy on their buddy list. Like user variable event handlers, these are most commonly used to store the data to the database. Not yet implemented.

Private Message Event Handler 密文事件

A private message event handler is used to listen for private messages sent between users and is most often used for message logging or custom filtering. Not yet implemented.

Extension Lifecycle Event Handler 擴充生命週期事件

An extension life cycle event handler is a special case event handler that is tied to a given extension, not to the server itself. It listens for both the extension start up and shut down notifications. It is generally used to initially load configuration data for the extension and provide that data to other components in the extension.

Audio/Video Event Handler 影音事件

An audio/video event handler is another multi-purpose event handler. It is used to approve someone attempting to publish or subscribe to a video stream much like a login event handler. It also serves as a notification that a stream has stopped playing or that a user is no longer subscribing.

2008/8/24

ElectroServer Extension

extension 可分為三類Event Handler、ManagedObject、Plug-in

Event Handler為Server Level 的事件監聽器
Plug-in為Room Level的事件監聽器

ManagedObject的解釋是
A managed object factory is a special case object that can be used to create objects that need to be tracked over time

<Extension>
<ManagedObjects>
<ManagedObject>…</ManagedObject>
</ManagedObjects>
<EventHandlers>
<LoginHandlers>
<LoginHandler>…</LoginHandler>
</LoginHandlers>
<LogoutHandlers>
<LogoutHandler>…</LogoutHandler>
</LogoutHandlers>
</EventHandlers>
<Plugins>
<Plugin>…</Plugin>
</Plugins>
</Extension>

2008/8/15

2008/7/13

ElectroServer載入外掛

ElectroServer載入外掛
http://www.es-wiki.com/index.php?title=Hello_World_Plugin_Tutorial

//Use the settings in the Extension.xml plugin here
var multiplyPlugin:Plugin = new Plugin();

//Use the extension from the xml file
multiplyPlugin.setExtensionName( "HelloWorldExtension" );

//Use the handle from the xml file
multiplyPlugin.setPluginHandle( "HelloWorldPlugin" );

//This can be any name you wish to give it, but normally if there is only one
//of a given plugin in an extension, best to use the handle name
multiplyPlugin.setPluginName( "HelloWorldPlugin" );

//Finally, attach this plugin to the CreateRoomRequest (you could have more than one, only one here though)
crr.setPlugins( [multiplyPlugin] );

2008/6/19

maya for pv3d

相信可以在flash上做很多的3D應用

http://blog.yam.com/milkmidi/article/12234526

2008/6/9

ElectroServer 基本使用方式


參考網址
http://www.es-wiki.com/index.php?title=Simple_Chat_Tutorial


es.addEventListener(MessageType.ConnectionEvent, "onConnectionEvent", this);
連線事件,回傳連線成功與否

es.addEventListener(MessageType.LoginResponse, "onLoginResponse", this);
登入事件,回傳登入成功與否

es.addEventListener(MessageType.JoinRoomEvent, "onJoinRoomEvent", this);
進入遊戲室時的事件

es.addEventListener(MessageType.PublicMessageEvent, "onPublicMessageEvent", this);
收到公開訊息事件

es.addEventListener(MessageType.UserListUpdateEvent, "onUserListUpdateEvent", this);
更新使用者事件

2008/6/5

建立elecreoserver server side程式

參考範例
http://www.es-wiki.com/index.php?title=Hello_World_Plugin_Tutorial

經過一翻研究之後,electroserver其實算是一個平台,基本上沒有所謂的server端,ElectroServer提供的是如使用者名單(user),遊戲室列表(room),遊戲區列表(zone),管理與同步化等服務,當然也包括使用者互傳訊息之類的服務。

在server端可以透過extension增加功能,但好像是類似RPC的功能..........

electroServer有點像battle net之類的平台,遊戲還是得由第一個開遊戲的人來進行處理。

但electroServer亦支援永久性的room,或許會像online game吧,這一點再研究看看。

2008/6/4

ElectroServer 測試

Electro server
http://www.es-wiki.com/index.php?title=Main_Page

web介面管理平台網址:

https://localhost:8080/admin/

general manage
  • license manage 認證管理,授權,如果有購買任何新的授權,可從這裡啟動
  • edit server settings 伺服器一般設定
  • Edit Thread Settings 管理多執行序相關設定,與效能有關
  • Restart or Shutdown Server 程始啟動與否
Security Settings
  • Manage Permission Sets
  • Manage Web Admin Users
  • Change Keystore Password
Gateway
Filters
  • Manage Flooding Filters 洗板面
  • Manage Language Filters 髒話過濾
  • Manage Word Lists
Extensions
  • 伺服器可透過Extensions擴充功能
  • 伺服器外掛放在[installation directory]/server/extensions
  • Create New Server-level Component
Persistent Rooms
  • 遊戲室,一般的Rooms在沒有使用者後就會自動移除,Persistent Rooms則是會一直存在的遊戲室

flash相關server

跟flash有關的server

electro server ,a free xmlsocket server for flash
http://www.electro-server.com/

red 5, flash server
http://red5flashserver.blogspot.com/2008/05/save-video-images-to-server-using-red5.html

smartfoxserver
http://www.smartfoxserver.com/

Unity
http://moock.org/unity/

rawfish-software
http://flashwanted.com/authors/rawfish-software.html

spicefactory
http://www.spicefactory.org/

nonoba 似手提供許多api服務
http://nonoba.com/developers/

其他
http://www.crgmedia.com/multi_player_flash.jsp
http://www.onnerby.se/~daniel/xmlsocketd/
http://www.gotoandplay.it/_articles/2003/12/xmlSocket.php
http://www.mediamacros.com/item/item-1006687599/


詳細功能待研究

跟flash 相關project
http://osflash.org/projects

2008/5/29

amfphp用法

一、使用Actionscript


二、使用remoteObject
Google-code-prettify原始碼效果


< ?xml version="1.0" encoding="utf-8"? >
< mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init(event)" >
< mx:DataGrid dataProvider="{dataProvider}" >
< mx:columns >
< mx:DataGridColumn headerText="userid" dataField="userid"/ >
< mx:DataGridColumn headerText="username" dataField="username"/ >
< mx:DataGridColumn headerText="email" dataField="emialaddress"/ >
< /mx:columns >
< /mx:DataGrid >
< mx:RemoteObject id="service" destination="amfphp"
source="mds01" showBusyCursor="true" >
< mx:method name="sayHello" result="func01(event)" fault="func02(event)" / >
< /mx:RemoteObject >

< mx:Script >
< ![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.remoting.RemoteObject;
import flash.net.Responder;

[Bindable]
public var dataProvider:Array;

public var gateway:NetConnection;
private function init(e:Event):void
{
gateway=new NetConnection();
gateway.objectEncoding=ObjectEncoding.AMF3;
gateway.connect("http://210.240.194.107/mds/gateway.php");

gateway.call('sample.getUsers',new Responder(onResult,onFault));

//gateway.call();

}
private function onResult(r:Array):void
{
trace("onResult")
dataProvider=r;
}
private function onFault(e:String):void
{
trace("onFault");
trace(e.toString());
}
private function func01(e:Event):void
{
trace("func01");
}
private function func02(e:Event):void
{
trace("func02");
}
]] >
< /mx:Script >
< mx:Button x="310" y="10" label="Button" click="{service.sayHello(event)}"/ >

< /mx:Application >

2008/3/12

HTTPService

............

2008/3/9

[Bindable]的作用

flex提供的資料綁定的功能

簡單說,就是a的一個屬性改變,b對應a的屬性也隨之改變。