mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 01:27:51 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,55 @@
|
||||
package waitingRoomFlow
|
||||
{
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import com.sbi.loader.IResourceStackable;
|
||||
import flash.events.Event;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLRequest;
|
||||
import loadProgress.LoadProgress;
|
||||
import resource.BaseResourceStackable;
|
||||
|
||||
public class ConnectToWaitingRoomServerResourceStackable extends BaseResourceStackable implements IResourceStackable
|
||||
{
|
||||
|
||||
private var _username:String;
|
||||
|
||||
public function ConnectToWaitingRoomServerResourceStackable(param1:String)
|
||||
{
|
||||
super();
|
||||
_username = param1;
|
||||
}
|
||||
|
||||
override public function init(param1:Function) : void
|
||||
{
|
||||
var _loc2_:URLLoader = null;
|
||||
super.init(param1);
|
||||
try
|
||||
{
|
||||
_loc2_ = new URLLoader();
|
||||
_loc2_.dataFormat = "text";
|
||||
_loc2_.addEventListener("complete",connectCompleteHandler,false,0,true);
|
||||
DebugUtility.debugTrace("ConnectToWaitingRoomServerResourceStackable init() - connect url:http://" + gMainFrame.clientInfo.waitingRoomServerAddress + ":" + gMainFrame.clientInfo.waitingRoomServerPort + "/connect username:" + _username);
|
||||
_loc2_.load(new URLRequest("http://" + gMainFrame.clientInfo.waitingRoomServerAddress + ":" + gMainFrame.clientInfo.waitingRoomServerPort + "/connect"));
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
DebugUtility.debugTrace("error connecting to waitingRoom server:" + e.getStackTrace());
|
||||
LoadProgress.show(true,"Error waiting for full server - please try again later");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private function connectCompleteHandler(param1:Event) : void
|
||||
{
|
||||
var _loc2_:String = param1.target.data;
|
||||
DebugUtility.debugTrace("my status is:" + _loc2_);
|
||||
if(_loc2_ == "")
|
||||
{
|
||||
LoadProgress.show(true,"Error connecting to waiting room server - please try again later");
|
||||
return;
|
||||
}
|
||||
super._resourceDoneLoadingCallback(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package waitingRoomFlow
|
||||
{
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import com.sbi.loader.IResourceStackable;
|
||||
import flash.display.MovieClip;
|
||||
import loadProgress.LoadProgress;
|
||||
import loader.MediaHelper;
|
||||
import resource.BaseResourceStackable;
|
||||
|
||||
public class LoadWaitingRoomMediaResourceStackable extends BaseResourceStackable implements IResourceStackable
|
||||
{
|
||||
|
||||
private const WAITING_ROOM_MEDIA_ID:int = 1678;
|
||||
|
||||
public var waitingRoom:MovieClip;
|
||||
|
||||
private var _setWaitingRoomClipCallback:Function;
|
||||
|
||||
private var _mediaHelper:MediaHelper;
|
||||
|
||||
public function LoadWaitingRoomMediaResourceStackable(param1:Function)
|
||||
{
|
||||
super();
|
||||
_setWaitingRoomClipCallback = param1;
|
||||
}
|
||||
|
||||
override public function init(param1:Function) : void
|
||||
{
|
||||
super.init(param1);
|
||||
try
|
||||
{
|
||||
_mediaHelper = new MediaHelper();
|
||||
_mediaHelper.init(1678,handleWaitingRoomMediaLoaded);
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
DebugUtility.debugTrace("error loading waitingRoom media:" + e.getStackTrace());
|
||||
LoadProgress.show(true,"Error loading waiting room - please try again later");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private function handleWaitingRoomMediaLoaded(param1:MovieClip) : void
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
_setWaitingRoomClipCallback(param1);
|
||||
}
|
||||
super._resourceDoneLoadingCallback(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
package waitingRoomFlow
|
||||
{
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import com.sbi.loader.ResourceStack;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import flash.events.TimerEvent;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLRequest;
|
||||
import flash.system.Security;
|
||||
import flash.utils.Timer;
|
||||
import loadProgress.LoadProgress;
|
||||
|
||||
public class WaitingRoom extends MovieClip
|
||||
{
|
||||
|
||||
public var mainLayer:DisplayLayer;
|
||||
|
||||
public var loadLayer:DisplayLayer;
|
||||
|
||||
private var _waitingRoomFlashVars:Object;
|
||||
|
||||
private var _resourceStack:ResourceStack;
|
||||
|
||||
private var _pollTimer:Timer;
|
||||
|
||||
private var _username:String;
|
||||
|
||||
private var _waitingRoom:MovieClip;
|
||||
|
||||
public function WaitingRoom(param1:Object)
|
||||
{
|
||||
super();
|
||||
_waitingRoomFlashVars = param1;
|
||||
}
|
||||
|
||||
public function waitCtorHelper() : void
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
Security.allowDomain("*");
|
||||
_username = _waitingRoomFlashVars.username;
|
||||
mainLayer = new DisplayLayer();
|
||||
addChild(mainLayer);
|
||||
_resourceStack = new ResourceStack(gMainFrame.path,gMainFrame.loaderCache.openFile);
|
||||
_resourceStack.pushClass(new ConnectToWaitingRoomServerResourceStackable(_username),false);
|
||||
_resourceStack.pushClass(new LoadWaitingRoomMediaResourceStackable(setWaitingRoomMovieClip),false);
|
||||
_resourceStack.start(waitingRoomSetupDone);
|
||||
loadLayer = new DisplayLayer();
|
||||
addChild(loadLayer);
|
||||
LoadProgress.init(loadLayer);
|
||||
gMainFrame.stage.quality = gMainFrame.currStageQuality;
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
_pollTimer.reset();
|
||||
_pollTimer = null;
|
||||
}
|
||||
|
||||
public function setWaitingRoomMovieClip(param1:MovieClip) : void
|
||||
{
|
||||
_waitingRoom = param1;
|
||||
mainLayer.addChild(_waitingRoom);
|
||||
}
|
||||
|
||||
private function waitingRoomSetupDone() : void
|
||||
{
|
||||
DebugUtility.debugTrace("waitingRoom setup done - starting poll timer");
|
||||
_pollTimer = new Timer(5000);
|
||||
_pollTimer.addEventListener("timer",handleWaitingRoomPollTimer);
|
||||
_pollTimer.start();
|
||||
LoadProgress.show(false);
|
||||
}
|
||||
|
||||
private function handleWaitingRoomPollTimer(param1:TimerEvent) : void
|
||||
{
|
||||
var _loc2_:URLLoader = null;
|
||||
try
|
||||
{
|
||||
_loc2_ = new URLLoader();
|
||||
_loc2_.dataFormat = "text";
|
||||
_loc2_.addEventListener("complete",pollCompleteHandler,false,0,true);
|
||||
DebugUtility.debugTrace("ConnectToWaitingRoomServerResourceStackable init() - connect url:http://" + gMainFrame.clientInfo.waitingRoomServerAddress + ":" + gMainFrame.clientInfo.waitingRoomServerPort + "/poll username:" + _username);
|
||||
_loc2_.load(new URLRequest("http://" + gMainFrame.clientInfo.waitingRoomServerAddress + ":" + gMainFrame.clientInfo.waitingRoomServerPort + "/poll"));
|
||||
}
|
||||
catch(e:Error)
|
||||
{
|
||||
DebugUtility.debugTrace("error polling waitingRoom server:" + e.getStackTrace());
|
||||
LoadProgress.show(true,"Error polling for full server - please try again later");
|
||||
_pollTimer.reset();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private function pollCompleteHandler(param1:Event) : void
|
||||
{
|
||||
var _loc2_:String = param1.target.data;
|
||||
if(_loc2_ == "")
|
||||
{
|
||||
LoadProgress.show(true,"Error with poll of waiting room server - please try again later");
|
||||
return;
|
||||
}
|
||||
if(_loc2_ == "enter")
|
||||
{
|
||||
LoadProgress.show(true,"Ready- please refresh to log in now!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user